free-jqgrid / jqGrid

jQuery grid plugin
https://github.com/free-jqgrid/jqGrid
Other
478 stars 196 forks source link

Can't reloadGrid from Bootbox callback #474

Open CanuckGamer opened 5 years ago

CanuckGamer commented 5 years ago

I setup my free jqGrid. I load data from my server, no problem. loadOnce is set to false.

I can do this without error: $('#grid').trigger('reloadGrid', [{ current: true }]);

... if I call this same line from within a Bootbox callback, the grid posts to my server and gets and displays the latest data, but my grid is no longer valid. For example, after calling reloadGrid from the Bootbox callback this:

jQuery("#grid").jqGrid('showCol', 1);

... now gives this error: "TypeError: jQuery("#grid").jqGrid is not a function"

But I can call that same line without error as long as I never reload the grid from my Bootbox callback.

If Bootbox calls reloadGrid, even inside the loadOnce event I get the TypeError as seen above.

antoineluong commented 5 years ago

Do you have a demo (in JSFiddle, for instance) where the problem can be reproduced?