RowReorder on server confirmation
RowReorder on server confirmation
veteze
Posts: 6Questions: 1Answers: 0
in RowReorder
I'm using rowreorder like this:
rowReorder: {
dataSrc: 1,
update: true,
selector: '.sortGridRow'
},
.on('row-reorder', function (e, diff, edit) {
var updatedIds = [];
var updatePositions = [];
for (var i = 0, ien = diff.length; i < ien ; i++) {
updatedIds.push(diff[i].node.id.substring(8));
updatePositions.push(diff[i].newPosition);
}
ServerSideCallToUpdateRows(updatedIds, updatePositions, function(result) {
if(result) {
//NOW RESET ORDERING IN DATATABLE
}
});
})
I'd like to lock the interface or only do the datatable update once the server has responded with a confirmation. Is there a way I can do this?
Thanks!
This discussion has been closed.
Replies
Unfortunately no.
row-reorder
is a simple notification that something has happened only - there is no way to "pause" the execution using the event handler. Sorry.Allan
yeah "pause"ing wouldn't be a sexy at all. a callback of some kind would make more sense. or a way for me to send a reference to my server call in as a rowReorder param
in rowReorder you call updateCallback and wait for a response back before doing the table re draws.
or a table.disable() / .enable()