I have been using inlineNav method for inline add as follows.
jQuery("#mygrid").jqGrid("inlineNav", "#mygrid_pager1",{"addParams":{"position":"last","addRowParams":{"keys":true}}});
It works great. Now, I need to reload the grid after adding a new row. I've tried the following and it didn't work.
jQuery("#mygrid").jqGrid("inlineNav", "#mygrid_pager1",{"addParams":{"position":"last","addRowParams":{"keys":true, "successfunc":"function(id){$("mygrid").trigger("reloadGrid");"}}});
Any pointers are appreciated!
I think the easiest way is after you finish add something, call reload function separately like
jQuery("#myGrid").reload();
First of all the value of
successfunc
should be the function and not the string (see in your current code"successfunc":"..."
)I would recommend you to try to add the same settings to both
addParams.addRowParams
and toeditParams
options ofinlineNav
. Moreover I would recommend you to place$(this).trigger("reloadGrid")
fromsuccessfunc
inside ofsetTimeout
to be sure that reloading will be started after the standard processing of saving of the row.So the code could be about the following: