我的 jqGrid 实例不想重新加载
我的 jqGrid 似乎没有重新加载。为什么会这样?
$(function(){
$last_name = $("#search_last_name").val();
$first_name = $("#search_first_name").val();
});
$("#search").click(function(){
jQuery("#list2").jqGrid('setGridParam',{url:"http://localhost/bcb/index.php/bcb_c/grid"});
jQuery("#list2").trigger("reloadGrid");
});
$("#list2").jqGrid({
url:'http://localhost/bcb/index.php/bcb_c/grid',
datatype: "json",
colNames:['id','First Name','Middle Name', 'Last Name', 'Address'],
colModel:[
{name: 'id', index:'id', width:20},
{name:'first_name',index:'first_name', width:120},
{name:'middle_name',index:'middle_name', width:120},
{name:'last_name',index:'last_name', width:120},
{name:'address', index:'address', width:120}
],
rowNum:10,
rowList:[10,20,30],
loadonce: true,
postData: {pass1: $last_name, pass2: $first_name},
pager: jQuery('#pager2'),
width: '550',
imgpath: gridimgpath,
scrollrows: true,
viewrecords: true,
sortorder: "desc"
});
My jqGrid doesn't seem to reload. Why might this be?
$(function(){
$last_name = $("#search_last_name").val();
$first_name = $("#search_first_name").val();
});
$("#search").click(function(){
jQuery("#list2").jqGrid('setGridParam',{url:"http://localhost/bcb/index.php/bcb_c/grid"});
jQuery("#list2").trigger("reloadGrid");
});
$("#list2").jqGrid({
url:'http://localhost/bcb/index.php/bcb_c/grid',
datatype: "json",
colNames:['id','First Name','Middle Name', 'Last Name', 'Address'],
colModel:[
{name: 'id', index:'id', width:20},
{name:'first_name',index:'first_name', width:120},
{name:'middle_name',index:'middle_name', width:120},
{name:'last_name',index:'last_name', width:120},
{name:'address', index:'address', width:120}
],
rowNum:10,
rowList:[10,20,30],
loadonce: true,
postData: {pass1: $last_name, pass2: $first_name},
pager: jQuery('#pager2'),
width: '550',
imgpath: gridimgpath,
scrollrows: true,
viewrecords: true,
sortorder: "desc"
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你应该使用
和
You should use
and