I'm not sure that I full understand your requirements. Nevertheless it seems to me that you need
- get the total number of grids on the page
- register "global"
Load_Complete
for all grids - set the counter to the total number of grids before starting preparing for printing, start reload the grids, decrements the counter inside of "global"
Load_Complete
handle andwindow.print()
if the counter will have the value 0.
So what you really need are two first things from the above list. Every grid will be build based on an empty <table>
element. jqGrid adds "ui-jqgrid-btable"
class to all the tables. So you can use
$(".ui-jqgrid-btable")
to get jQuery wrapper to all grids on the page. $(".ui-jqgrid-btable").length
is the number of grids. To register common "global" Load_Complete
for all grids you can use jqGridLoadComplete
(or jqGridAfterLoadComplete
) event (see the documentation):
$(".ui-jqgrid-btable").bind("jqGridLoadComplete", function (e, data) {
// ...
});
See the answer for additional information.
I hope you will be able to implement all your requirements in the way.