Reputation: 779
I have the following code for the delete row:
HTML
<div class="Delete">Delete</div>
Jquery
$("div.Delete").live("click", function(){
toDelete = $("#myjqgrid").jqGrid('getGridParam','selrow');
$("#myjqgrid").jqGrid('delGridRow',toDelete);
});
So, when I click on the "Delete" div
:
How can I make delete row work on the client side?
Upvotes: 1
Views: 4588
Reputation: 221997
I think that you should just use reloadAfterSubmit: false property of delGridRow method:
$("#myjqgrid").jqGrid('delGridRow', toDelete, {reloadAfterSubmit: false});
If you in general prefer such behavior on the deleting of the rows by delGridRow method you can change the default parameters with
$.extend($.jgrid.del, {reloadAfterSubmit: false});
If you include the code somewhere at the beginning all calls of delGridRow
will use reloadAfterSubmit: false
by default. By the way it's the standard setting which I mostly use.
Upvotes: 2
Reputation: 384
if your problem just in get confirm from client, use confirm in your code:
$("div.Delete").live("click", function(){
if (confirm("Are You Sure?")) {
toDelete = $("#myjqgrid").jqGrid('getGridParam','selrow');
$("#myjqgrid").jqGrid('delGridRow',toDelete);
}
});
Upvotes: 0