I have been trying to use jqgrids, default CRUD options. Below is my code:
$("#roleFlexigrid").jqGrid( {
//url : 'roleList.htm?t=' + new Date().getTime(),
//method : 'GET',
datatype : 'jsonstring',
datastr: gridData,
colNames : [ 'Name' ],
colModel : [ {
name : 'name',
search : 'true',
index : 'name',
width : 665,
jsonmap : "cell.name"
} ],
jsonReader : {
repeatitems : false,
root : "rows",
cell : "cell",
id : "id",
page : "page",
records : "records"
},
viewrecords : "true",
prmNames : {
rows : "rp",
sort : "sortname",
order : "sortorder"
},
pager : "#pager",
rowNum : 10,
rowList : [ 10, 20, 30 ],
sortorder : "asc",
sortname : "name",
caption : "Roles",
height : 210
});
$("#roleFlexigrid").jqGrid('navGrid', '#pager', {
add:true,
del : true,
search : true,
refresh : true
}, {}, // edit parameters
{ // add parameters
url : 'addRole.htm'
});
Right now all i am getting is a blank add dialog box, with no fields. How do I configure it to get all the fields and submit url stuff. Also is there a way to customize these CRUD dialog boxes, like adding/changing message or buttons etc.
Thanks!
Try marking the field as
editable:From the docs: