开发者

trigger reloadGrid in jqGrid works only after alert show

I tried but reload is triggered only after alert is shown ex:

$("#gs_title").val('test');
$('#mygrid').trigger('reloadGrid');

nothing.

$("#gs_title").val('test');
alert('loaded');
$('#mygrid').trigger('reloadGrid');

works (data reloaded). I can't figure why, but using $("#开发者_Python百科mygrid")[0].triggerToolbar() does not works too.


Probably the demo from the old answer do what you want.

UPDATED: Another demos: this and this can be another way to implement not what you do, but what you probably need: to filter the data at the load time. (see this answer for example)

UPDATED 2: You don't posted more code, so it's difficult to comment the code. Moreover you don't explain what you want to do, don't describe the context. It can be for example, that you have jqGrid which will be filled with remote data (datatype:'json' or datatype:'xml'). In the case the reloadGrid will be ignored till the previous ajax call not ended.


Are you sure you're waiting for the DOM to load?

$(document).ready(function()
{
  $("#gs_title").val('test');
  $('#mygrid').trigger('reloadGrid');
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜