I have a jqGrid which I am binding dynamically. I'm using jqgrid version 5.2
I have to implement add/edit/delete on the dynamic data. I have set add, edit delete as true in navgrid option
$("#grdRawData").jqGrid({
url: vURLJQ,
datatype: 'local',
contentType: 'application/json; charset=utf-8',
data: data.d.IDresult,
mtype: 'Get',
iconSet: "fontAwesome",
styleUI: "Bootstrap",
guiStyle: "bootstrap",
colNames: BuildColumnNames(col),
colModel: BuildColumnModel(col),
localReader: {
root: data.d.IDresult,
page: 1,
total: 1500,
records: data.d.IDresult.length
// repeatitems: false
//Id: "0"
},
pager: jQuery('#grdRawDataPager'),
height: '100%',
width: '100%',
rowNum: 10,
rowList: [10, 50, 100, 150, 200],
//sortname: 'Urgency',
//sortorder: "asc",
viewrecords: true,
loadonce: true,
editurl: 'clientArray',
overlay: 0,
//pgbuttons: true,
//pginput: false,
emptyrecords: 'No records',
loadComplete: function() {
var gridData = $("#grdRawData").jqGrid('getRowData');
}
}).navGrid('#grdRawDataPager', {
edit: true,
add: true,
del: true,
search: true,
searchtext: "Find"
});
But when I edit a record, the edit dialog appears but empty. Can anyone help me here, please? I'm not able to add/edit/delete the dynamic data-bound to my jqGrid.
Thanks in advance
Since the colModel is not published, the only reason that there are no fields in the edit form is that you do not set the editable option true in colModel. Try with this colModel:
$("#grdRawData").jqGrid({
colModel: [
{name: 'Active', editable: true},
{name: 'Billable', editable: true},
{name: 'Cart', editable: true},
{name : 'Category', editable: true },
{name : 'Cart_Value', editable: true},
{name: 'Category', editable: true},
{name: 'Sys_ID', key : true, editable: true},
{name : 'Class', editable: true},
{name : 'Created', editable: true}
],
...
});