Hi,
I need to select multiple rows in a kendo grid and move them inside the grid to reorder them.
I'm using kendoSortable
grid.table.kendoSortable({
filter: ">tbody >tr",
hint: function (element) {
//customize the hintvar table = $(
'<table style="width: 600px;" class="k-grid k-widget"></table>'
),
hint;
table.append(grid.select().clone()); //append the dragged element
table.css("opacity", 0.7);
return table; //return the hint element
},
cursor: "move",
placeholder: function (element) {
return $('<tr colspan="4" class="placeholder"><td colspan ="' + grid.columns.length + '">Drop here</td></tr>');
},
change: function (e) {
console.log(grid)
var selectedId = [];
grid.select().each(function(){
selectedId.push(this.getElementsByClassName('idCompOperation')[0].innerText);
});
// do some stuff
}
});
In the change function I can get the multiple elements selected and change the order of them in the datasource but visually only the first column selected is moved in the table iven if I refresh the grid
Select 2 rows:
Drag to the beginning of the table
Just the first of the 2 rows is moved the other remains at the bottom
How can I do?
Thanks Mik