0

I have a dropdown button where a user can select filters to filter jqgrid.

Here is what it looks like

jQuery("#filter_not_on_server").click(function (e) {
                jQuery(grid_selector).jqGrid('setGridParam', { url: '<?php echo APP_URL; ?>/php/user/edit_appfilter.php?filter=true&server_filter=null', page: 1 }).trigger("reloadGrid");
                e.preventDefault();
            });

So it works fine except when the filter returns no results. When that happens i get a "NetworkError: 500 Internal Server Error".

It is a good possibility in some cases so i would like to handle when that happens. I would simply like to clear the grid when that happens with no rows.

is this possible?

BigDX
  • 3,519
  • 5
  • 38
  • 52

1 Answers1

0

It seems to me that you should add loadError callback to jqGrid to handle the exception on the server. The answer provides different implementations of loadError. You can include in your implementation any custom actions like clear the grid content using clearGridData method, displaying your custom message and so on.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798