I generate my jqgrid from model class which I pass into view. I get constructed and working jqgrid. However, I want to set postData on one view, where I use jqGrid, from script in that view, after I call helper for creating jqgrid, without having to change whole partial view which creates jqgrid.
I tried running
$("#@Model.Id").jqGrid('setGridParam', { postData: { test: 233} });
and
$("#@Model.Id").setGridParam({ postData: { test: 233} });
but without error or any result. If I set postData in jqgrid parameters (in partial view where it is constructed, it works.
I also checked that grid exists, added
console.log($("#@Model.Id").size());
before the first line, and it shows 1.
UPDATE: This .setGirdParam function started to work for me for no apparent reason, so I will accept answer if someone can give some insight what can prevent this from working. Thanks