A page like http://trirand.com/blog/jqgrid/jqgrid.html Hierarchy example, but more complex, there are 'add' buttons for every grid, when user click on 'add' button, we need to handle added data.
We also refer page http://www.ok-soft-gmbh.com/jqGrid/LocalFormEditing.htm for local editing, related code is below:
jqGrid('navGrid','#pager',{},editSettings,addSettings,delSettings,
{multipleSearch:true,overlay:false, null});
addSettings = {
//recreateForm:true,
jqModal:false,
reloadAfterSubmit:false,
savekey: [true,13],
closeOnEscape:true,
closeAfterAdd:true,
onclickSubmit: function (options, postdata) {
// expected to find grid id in options, but didn't find it.
},
},
I hope that I understand your question correctly. You create multiple grids on the page and add navigator bar to the grids. You problem probably was in the old code of the referenced demo which I prepared for the old answer.
The answer was written at the time of jqGrid version 3.8.2. Later the code of form editing was changes so that
this
will be set on the DOM of the current editing grid inside ofonclickSubmit
like inside of all other jqGrid callbacks. So one can use$(this)
to access to the grid. More recent demo created for jqGrid 4.4.1, I posted for the answer.I looked through the code of local format editing from two referenced answers, but the current version of jqGrid (4.5.4) contains more changes which required to adjusting the code. So I modified my demo one more time. The resulting demo seems me working correctly in jqGrid 4.5.4. It's code I includes below: