I suppose that strust 2 jquery grid plugin uses some old jqGrid in version 4.6/4.7. Starting with version 4.4.4 jqGrid supports onInitGrid
callback and jqGridInitGrid
event which could be very helpful in your case. The callback/event will be called/triggered after the outer elements of jqGrid will be build (column headers for example), but before the first filling of the grid with data (before the first call of internal populate
method).
Thus you can use the following code for the required changes:
$("#gridtable").bind("jqGridInitGrid", function (e) {
$(this).jqGrid("setColProp", "amount", { summaryType: "sum" });
});
It's important to understand that you can/should make the binding before creating the grid because the empty <table id="gridtable"></table>
already exist and the binding will be not changed during creating jqGrid.
Free jqGrid has another callback beforeInitGrid
and the corresponding event jqGridBeforeInitGrid
, which will be called earlier, before any outer parts of jqGrid will be created, but the jqGridInitGrid
event would be enough for your purpose already.