我正在使用 Asp.net MVC4、jqgrid 4.4.4 和 jquery 1.9 jqGrid 从查询加载到数据库,但我无法过滤字段,当我输入值时不搜索,它向我显示相同的值,但是当我在 jqgrid 中定义值 loadonce: true 仅在第一个搜索页面中,我该如何解决这个问题?我应该在哪里修改代码?
这是我的代码,jqgrid:
jQuery(document).ready(function () {
jQuery("#tbBuscaRec").jqGrid({
url: '@Url.Action("DatosBuscaPersona", "raTabPersonaReclamante")',
datatype: 'json',
mtype: 'POST',
postData: { Parametro: Param },
colNames: ['Id', 'IdPer', 'Doc', 'CI/NIT', 'Nombres', 'Apellido Paterno', 'Apellido Materno', 'Apellido Esposo'],
colModel:
[
{ name: 'ip_idpersona', index: 'ip_idpersona', formatter: 'number', hidden: true },
{ name: 'ip_idpersonadoc', index: 'ip_idpersonadoc', formatter: 'text', hidden: true },
{ name: 'ip_partipodoc', index: 'ip_partipodoc', align: 'left', width: '4', editable: true, edittype: 'text', editoptions: { readonly: true }, search: false },
{ name: 'ip_nrodoc', index: 'ip_nrodoc', sortable: true, align: 'left', width: '8', editable: true, edittype: 'text', editoptions: { readonly: true} },
{ name: 'ip_nombres', index: 'ip_nombres', sortable: true, align: 'left', width: '15', editable: true, edittype: 'text', editoptions: { readonly: true} },
{ name: 'ip_appaterno', index: 'ip_appaterno', sortable: true, align: 'left', width: '15', editable: true, edittype: 'text', editoptions: { readonly: true } },
{ name: 'ip_apmaterno', index: 'ip_apmaterno', sortable: true, align: 'left', width: '15', editable: true, edittype: 'text', editoptions: { readonly: true} },
{ name: 'ip_apesposo', index: 'ip_apesposo', sortable: false, align: 'left', width: '15', editable: true, edittype: 'text', editoptions: { readonly: true} }
],
pager: '#pg_tbBuscaRec',
rowNum: 100,
rowList: [100, 200, 300],
sortname: 'ip_nombres',
sortorder: 'asc',
rownumbers: true,
multiselect: false,
gridview: true,
height: 180,
width: 490,
ignoreCase: true,
// loadonce: true,
});
});
jQuery("#tbBuscaRec").jqGrid('navGrid', '#pg_tbBuscaRec', { view: false, edit: false, add: false, del: false }, {}, {}, {}, { multipleSearch: true, closeAfterSearch: true, closeOnEscape: true });
jQuery("#tbBuscaRec").jqGrid('filterToolbar');
jQuery("#tbBuscaRec").trigger("reloadGrid", [{ current: true}]);