您当前的位置: 首页 >  搜索

杨林伟

暂无认证

  • 2浏览

    0关注

    3337博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

10jqGrid - 搜索操作

杨林伟 发布时间:2019-04-24 10:34:49 ,浏览量:2

表格中所有的列都可以作为搜索条件。 所用到的语言包文件

$.jgrid = {  

...  
   search : {  
     caption: "Search...",  
     Find: "Find",  
     Reset: "Reset",  
     odata : ['equal', 'not equal', 'less', 'less or equal','greater','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain'],  
     groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" } ],  
     matchText: " match",  
     rulesText: " rules"  
   }

colModel 设置: 在这里插入图片描述 searchoptions 参数: 在这里插入图片描述

jQuery("#grid_id").jqGrid({  
...  
   colModel: [   

      ...   

      {name:'price', index:'price', width:60, search:true, stype:'text', searchoptions:{dataInit:datePick, attr:{title:'Select Date'}} },  

      ...  

   ]  

...  

});  

datePick = function(elem)  

{  
   jQuery(elem).datepicker();  
}

需要说明的:

  • 所有的搜索都是使用url来到服务器端查询数据。
  • 当执行搜索时会用查询数据填充postData array
  • 发送到服务器端搜索字符串的名称为_search
  • 当点击刷新按钮时不会使用搜索条件
  • 每个搜索方法都有自己的数据清空方法
搜索工具栏

搜索工具栏只是在列标题下面构造一个输入框。且使用表格的url进行搜索记录,发到服务器端数据格式为name:value,而且是附加在postData之后。

  • jQuery("#grid_id").filterToolbar(options);
  • jQuery("#grid_id").jqGrid(‘filterToolbar’,options);

options:参数 在这里插入图片描述

方法: 在这里插入图片描述

自定义搜索
jQuery("#mysearch").filterGrid('#grid_id',options);

options:参数 在这里插入图片描述 在这里插入图片描述

关注
打赏
1662376985
查看更多评论
立即登录/注册

微信扫码登录

0.0594s