当我单击jqGrid中的搜索按钮时,搜索弹出窗口未显示。我已经给出了search=true
,我已经完成了另一个项目,它工作正常。我不明白出了什么问题。有什么遗漏吗。请任何人都可以帮助这个。或者任何人都可以帮助如何在 jquery 中为此手动搜索功能。
插件
<link href="@Url.Content("~/Content/ui.jqgrid.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/grid.locale-en.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.jqGrid.min.js")" type="text/javascript"</script>
查看代码:
@using (Html.BeginForm())
{
<table id="Channelslistgrid" cellpadding="0" cellspacing="0">
</table>
<div id="pager" name="pager" style="text-align: center;">
</div>
}
代码:
<script type="text/javascript">
$(function () {
$("#Channelslistgrid").jqGrid({
colNames: ['Title', 'Description', 'LogoFileName' ],
colModel: [
{ name: 'Title', index: 'ChannelName', sortable: true, align: 'left', width: '200',
editable: false, edittype: 'text',search:true,searchoptions:{sopt:['eq']}
},
{ name: 'Description', index: 'Description', sortable: false, align: 'left', width: '120',
editable: false, edittype: 'text',search:true,searchoptions:{sopt:['eq']}
},
{ name: 'Logo', index: 'Logo', align: 'left', formatter: unitsInStockFormatter, sortable: false, width: '100',
editable: false,search:false
}
],
pager: jQuery('#pager'),
sortname: 'Title',
rowNum: 15,
rowList: [15, 20, 25],
sortorder: "desc",
height: 345,
viewrecords: true,
rownumbers: true,
caption: 'ChannelsList',
width: 660,
url: "@Url.Content("Urlpathgiven")",
datatype: 'json',
mtype: 'GET'
})
jQuery("#Channelslistgrid").jqGrid('navGrid', '#pager', { edit: false, add: false, del: false, search: true, refresh: true },
{ closeOnEscape: true, reloadAfterSubmit: true, closeAfterEdit: true, left: 400, top: 300 },
{ closeOnEscape: true, reloadAfterSubmit: true, closeAfterAdd: true, left: 450, top: 300, width: 520 },
{ closeOnEscape: true, reloadAfterSubmit: true, left: 450, top: 300 },
{closeAfterSearch:true,closeAfterReset:true,left: 450, top: 300}
);
});
</script>