I am trying to edit, insert and delete inline in jqGrid and successfully do so for insert and edit BUT not for delete. I read about using 'clientArray' and it does the trick as I mentioned for the edit, but not for the delete. When the delete function is called, the message for deletion pops, but when clicking on delete, I get the message: "No url is set".
What am I doing wrong? These are the functions that get called when clicking on the the appropriate buttons.
function _deleteLine(rowId) {
var id = rowId;
if (_.isNumber(id) === false) {
id = rowId.id;
}
self.$grid.delGridRow(id, false, 'clientArray');
}
function _editLine(rowId) {
var id = rowId;
if (_.isNumber(id) === false) {
id = rowId.id;
}
self.$grid.jqGrid("editRow", id, true);
_toggleActionButtons(true, id);
}
function _saveLine(rowId) {
var defer = $.Deferred();
var id = rowId;
if (_.isNumber(id) === false) {
id = rowId.id;
}
self.$grid.saveRow(id, false, 'clientArray');
toggleActionButtons(false, id);
return defer.promise();
}
Update:
After changing the delete function to the following I was able to remove the item, however, to modal doesn't close. I looked at this and followed it but wasn't able to solve:
function _deleteLine(rowId){
options.processing = true;
var grid_id = $.jgrid.jqID(this.p.id);
self.$grid.jqGrid("delRowData", rowid);
$.jgrid.hideModal("#delhd" + grid_id, {
gb: "#gbox_" + grid_id,
jqm: true
});
}