Asp.net MVC4, jqgrid 4.4.4 및 jquery 1.9로 작업 중입니다. jqGrid가 쿼리에서 데이터베이스로로드되었지만 필드를 필터링 할 수 없습니다. 값을 넣으면 검색되지 않지만 동일한 값을 표시하지만 jqgrid에서 값을 정의하면 loadonce : 첫 번째 검색 페이지에서만 true, 어떻게이 문제를 해결할 수 있습니까? 어디에서 코드를 수정해야합니까? 데이터베이스에서 jqgrid로드가 작동하지 않습니다. filterToolbar
이
내 코드,있는 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}]);
: 컨트롤러 액션'@의 Url.Action TRUE '("DatosBuscaPersona를", "raTabPersonaReclamante")'** 모든 데이터 ** (대신 한 페이지의 반환해야 데이터)를'sidx'와'sord'에 대응하여 정렬합니다. 또는 ** 서버 측 필터링 **을 구현해야합니다 (Mark의 답변 참조). – Oleg