Fired when the user changes the order of a row.
The event handler function context (available via the this
keyword) will be set to the widget instance.
jQuery
The jQuery object representing the table row being reordered.
e.rowsjQuery
Available when multiple rows are dragged - the jQuery object representing the selected and dragged rows.
When you Drap and Drop multiple items from one instance of the Grid to another the selected and dragged rows are available by the selected rows of the external Grid via the
select
method.
selectedRows = externalGrid.select();
Number
The new row index.
e.oldIndexNumber
The previous row index.
e.senderkendo.ui.Grid
The widget instance which fired the event.
e.preventDefaultFunction
If invoked prevents the rowReorder action - prevents the client-side reordering.
Example<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: [
{ id:1, name: "Jane Doe", age: 30 },
{ id:2, name: "John Doe", age: 33 }
],
reorderable: {
rows: true
},
rowReorder: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.row, e.newIndex, e.oldIndex);
}
});
</script>
Example - reordering with multiple selection
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: [
{ id:1, name: "Jane Doe", age: 30 },
{ id:2, name: "John Doe", age: 33 }
],
reorderable: {
rows: true
},
selectable: "multiple, row",
rowReorder: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(e.row, e.rows, e.newIndex, e.oldIndex);
}
});
</script>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4