Hi Abu-
I have to pass the filters of a grid to another grid in the same page.
I use this code, in the event 'js_on_load_complete' the first grid:
var grid = $("#list1");
$(grid).resetSelection();
fltrs = $(grid).getGridParam("postData").filters;
if (fltrs!==undefined && fltrs!="" {
setTimeout(function () {
cgrid = $("#list2");
p = cgrid.jqGrid("getGridParam");
cgrid[0].p.search = true;
cgrid[0].p.postData.filters = fltrs;
cgrid.triggerHandler("reloadGrid");
});
}
and it works well.
But I would like that the second grid can set other filters and that these added filters can be passed to the first grid.
But if I copy the above code in the event 'js_on_load_complete' of the second grid the script enters a loop.
Suggestions?
Thanks in advance
Massimo Gagliardi
When calling this code from second grid, you can set some kind of global JS variable, e.g. var flag = 1;
and put whole code of first grid inside (!flag==1){ … }