I am creating my jqgrid from a model class that I am passing into view. I get a built and working jqgrid. However, I want to set postData in one view, where I use jqGrid from a script in that view after I call the helper to create jqgrid without changing the whole partial view that jqgrid creates.
I tried to run
$("#@Model.Id").jqGrid('setGridParam', { postData: { test: 233} });
and
$("#@Model.Id").setGridParam({ postData: { test: 233} });
but without errors or any result. If I set postData in jqgrid parameters (in the partial view where it is built, it works.
I also checked that the mesh exists, added
console.log($("#@Model.Id").size());
before the first line, and it shows 1.
UPDATE: this .setGirdParam function started working for me for no apparent reason, so I will accept the answer if someone can give some idea of ββwhat might prevent this from working. Thanks
Goran obradovic
source share