在我的网格中,我有一个用于单个搜索的图标搜索,但搜索对话框确认一直在左上角弹出。我想让搜索对话框确认在 jqgrid 的中心,而不是在左上角。这是我的代码..
<script type="text/javascript">
jq(function() {
jq("#grid").jqGrid({
url:'/SpringGrid/yudi/crud',
datatype: 'json',
mtype: 'GET',
colNames:['Id', 'First Name', 'Last Name'],
colModel:[
{name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10},hidden:true},
{name:'firstName',index:'lastName', width:100,editable:true, editrules:{required:true}, editoptions:{size:10},sortable:true},
{name:'lastName',index:'firstName', width:100,editable:true, editrules:{required:true}, editoptions:{size:10},sortable:true}
],
postData: {
},
rowNum:20,
rowList:[20,40,60],
height: 200,
autowidth: true,
rownumbers: true,
pager: '#pager',
sortname: 'id',
viewrecords: true,
sortorder: "asc",
caption:"Users",
emptyrecords: "Empty records",
loadonce: false,
loadComplete: function() {
},
jsonReader : {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
cell: "cell",
id: "id"
}
});
jq("#grid").jqGrid('navGrid','#pager',
{edit:false,add:false,del:false,search:true},
{ },
{ },
{ },
{
sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'],
closeOnEscape: true,
multipleSearch: true,
closeAfterSearch: true }
);
jq("#grid").navButtonAdd('#pager',
{ caption:"Add",
buttonicon:"ui-icon-plus",
onClickButton: addRow,
position: "last",
title:"",
cursor: "pointer"
}
);
jq("#grid").navButtonAdd('#pager',
{ caption:"Edit",
buttonicon:"ui-icon-pencil",
onClickButton: editRow,
position: "last",
title:"",
cursor: "pointer"
}
);
jq("#grid").navButtonAdd('#pager',
{ caption:"Delete",
buttonicon:"ui-icon-trash",
onClickButton: deleteRow,
position: "last",
title:"",
cursor: "pointer"
}
);
jq("#btnFilter").click(function(){
jq("#grid").jqGrid('searchGrid',
{multipleSearch: false,
},
sopt:['eq']}
);
});
// Toolbar Search
jq("#grid").jqGrid('filterToolbar',{stringResult: true, searchOnEnter : true});
});
</script>