我正在使用以下 jqgrid 代码:
jQuery("#list2").jqGrid({
url:'<?php echo $url;?>',
datatype: "json",
colNames:[
<?php
$sep = "";
foreach($columns as $col){
echo $sep . "'" . $col['header'] . "'";
$sep = ",";
}
?>
],
colModel:[
<?php
$sep = "";
foreach($columns as $col){
echo $sep . "{name:'" . $col['name'] . "',index:'" . $col['name'] . "', width:" . $col['width'] . ", sortable:true, search:true}";
$sep = ",";
}
?>
],
rowNum:100,
rowList:[100,200,300,400],
pager: '#pager2',
loadonce: true,
sortname: 'geneID',
viewrecords: true,
width:700,
shrinkToFit:false,
height:700,
sortorder: "desc",
caption:"Breeder Tool Box"
});
jQuery("#list2").navGrid('#pager2',{add: false, edit: false, del: false,search : true , refresh : true},{},{},{});
jQuery("#list2").searchGrid({multipleSearch:true}); // For Adding the Multiple Search Option on the jqgrid
每当加载网格时,搜索框就会默认打开。
我只在单击 jqgrid 工具栏下部的搜索选项后才尝试获取搜索框
您能否指出我的代码中缺少/错误的部分