This is returning the columns collection's ordering before the reorder occurs. How do I access the new columns collection during the columnReorder event?
2 Answers, 1 is accepted
0
Daniel
Telerik team
answered on 15 Jan 2015, 01:07 PM
Hello,
Indeed, the event is triggered before the columns are actually reordered so the columns array will be the old one. You could either use a timeout to wait for the columns to be reordered:
columnReorder: function (e) {
setTimeout(function () {
var columns = e.sender.columns;
}, 0);
}
or the newIndex and oldIndex parameters to get the columns in the updated order.
var columns = e.sender.columns.slice(0);
var column = columns.splice(e.oldIndex, 1)[0];
columns.splice(e.newIndex, 0, column);
Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!