admin管理员组文章数量:1391987
setSelection does not select the row, whose id is 2, right after a reloadGrid.
$("#training").setGridParam({url: 'index.php?func=trainingmgr&aAction=refreshData'});
$("#training").trigger("reloadGrid");
$("#training").jqGrid('setSelection', "2″);
However, setSelection can select the row, whose id is 2, when you take this line out: $("#training").trigger("reloadGrid");
Anybody experiences the same issue?
Thanks
setSelection does not select the row, whose id is 2, right after a reloadGrid.
$("#training").setGridParam({url: 'index.php?func=trainingmgr&aAction=refreshData'});
$("#training").trigger("reloadGrid");
$("#training").jqGrid('setSelection', "2″);
However, setSelection can select the row, whose id is 2, when you take this line out: $("#training").trigger("reloadGrid");
Anybody experiences the same issue?
Thanks
Share Improve this question edited Mar 29, 2010 at 6:57 Matt Blaine 1,97614 silver badges22 bronze badges asked Mar 27, 2010 at 14:17 Viet PhamViet Pham 111 silver badge2 bronze badges2 Answers
Reset to default 5You should select row after the jqGrid will be filled. So you should place
$("#training").jqGrid('setSelection', "2");
inside of loadComplete
event handler and not call this immediately after $("#training").trigger("reloadGrid");
because trigger
call jQuery.ajax
which work asynchronously.
In several places in my application I am calling reloadGrid
followed by setSelection
, and the row is being selected successfully. Something else must be going on with your application. Did you try running this in Firebug to see if any errors are being thrown?
本文标签: javascriptjqGrid39s setSelect does not work after reloadGridStack Overflow
版权声明:本文标题:javascript - jqGrid's setSelect does not work after reloadGrid - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744710370a2621094.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论