开发者

filterToolbar not working

开发者 https://www.devze.com 2023-03-13 21:23 出处:网络
Text boxes are appearing below the header but on entering values nothing is happening. Though after hiting the enter button it shows \"loading\" sign but no change in the grid.

Text boxes are appearing below the header but on entering values nothing is happening. Though after hiting the enter button it shows "loading" sign but no change in the grid. M using below code for filterToobar. I have written this code just after the definition of jqgrid and inside the $.ready function(everthing else is working fine in my code). My browser is IE7

jQuery("#list").jqGrid({ 
    url: 'someactionclass'
    datatype: "json",
    mtype: "POST",       
    colNames ,
    colModel,
    rowNum:25,
    rowList:[25,50,75,100],
    pager: '#pager',
    sortname: 'rgs_id',
    height: '100%',
    sortorder: "asc", 
    editurl:'someactionclass'
}); 
jQuery("#list").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false });
jQuery("#list").jqGrid('navButtonAdd', "#pager",
    { caption: "Toggle", title: "Toggle Sear开发者_如何学Goch Bar", buttonicon: 'ui-icon-pin-s', 
      onClickButton: function () { $("#list")[0].toggleToolbar() } }); 


You use server side data type: datatype: "json". In the case the server is responsible to sorting, paging and filtering of data. The jqGrid just add the filtering parameters as additional parameters and send there to the server.

If you want use local-side sorting, paging and filtering of data you can use loadonce:true parameter. In the case you should include the server response the whole data (all pages) from the grid. You should understand, that in the case the datatype of the grid will be automatically changed from datatype: "json" to datatype: "local" after the first data loading. If you will need reload the data from the server you will have to change the datatype back to the original datatype: "json" value with respect of setGridParam method and then reload the grid.

You should use gridview:true jqGrid parameter to improve jqGrid performance. In any way the acceptable performance of local sorting and filtering you can receive only for not so large number of rows. The usage of not large page size (25 rows for example which can be placed on the page without scrolling) can additionally improve the performance.

0

精彩评论

暂无评论...
验证码 换一张
取 消