sir:
i noticed that object name in
onItemUpdated
{
...
previuosItem
}
onItemUpdating
{
...
previuosItem
}
correct object name is "previousItem".
another issue is
when i try to update one row data but failed , then i clicked "search" button not "x" button , wrong data will still keep on it.
my config
{
inserting: true,
filtering: true,
editing: true,
sorting: true,
autoload: true,
paging: true,
pageSize: 10,
pageButtonCount: 5
.....
}
thanks for your help
Thank you for the report.
Docs is fixes.
I've managed to reproduce the updateItem issue.
For now you can do the following:
Always resolve the result of updateItem, but in case of fail just resolve it with lastPrevItem. You can save the lastPrevItem on onItemUpdating callback from args.previousItem.
updateItem: function(updatingClient) {
var result = $.Deferred();
// your ajax call instead of rejected
var ajaxDeferred = $.Deferred().reject();
ajaxDeferred.done(function(updatedItem) {
result.resolve(updatedItem);
}).fail(function() {
result.resolve(lastPrevItem);
});
return result.promise();
}
See the working fiddle: http://jsfiddle.net/tabalinas/2LLha4r7/
wow! thank you sir.
Most helpful comment
Thank you for the report.
Docs is fixes.
I've managed to reproduce the
updateItemissue.For now you can do the following:
Always resolve the result of
updateItem, but in case of fail just resolve it withlastPrevItem. You can save thelastPrevItemononItemUpdatingcallback fromargs.previousItem.See the working fiddle: http://jsfiddle.net/tabalinas/2LLha4r7/