asp.net mvc - jqgrid load from database does not work filterToolbar -
i'm working asp.net mvc4, jqgrid 4.4.4 , jquery 1.9 jqgrid loaded query database, can not filter fields, when put value doesn't search, shows me same values, when define in jqgrid value loadonce: true in first search page, how can resolve problem? should modify code?
this code, 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}]);
by default filtering handled controller, , see these values being passed controller in _search
, filters
.
the reason loadonce: true
working on first page is doing filtering on client side.
i suggest checking out oleg's answer on filtering @ link below, put me on track server side filtering application.
Comments
Post a Comment