默认情况下在jqGrid中使用工具栏搜索在列的中间进行搜索 [英] Search in the middle of a column by default in jqGrid with toolbar search

查看:356
本文介绍了默认情况下在jqGrid中使用工具栏搜索在列的中间进行搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读jqGrid Wiki之后(并从以下示例中进行阅读:不区分大小写的情况在包含隐藏字段的jqGrid中搜索),我找不到我想做的事情.

After reading the jqGrid wiki (and taking example from: Case insensitive search in jqGrid including hidden fields), I cannot find what I want to do.

是否有任何搜索选项可启用列中任何位置的搜索(自动通配符).

Is there any search option to enable a search anywhere in a column (automatically wildcarded).

如果该列包含"Apple Iphone",则可以通过搜索"iphone"找到它.

If the column contains "Apple Iphone" I would be able to find it by using the search "iphone".

SQL等效项为select * from table where lower(columnX) like '%iphone%';

推荐答案

由于您使用

Since you use toolbar searching the solution of your problem seems to be simple. You should:

    在jqGrid参数中
  1. 包括ignoreCase:true
  2. filterToolbar 的调用中包含defaultSearch:'cn'选项.例如:$("#list").jqGrid('filterToolbar', {defaultSearch:'cn'}).
  3. 如果在搜索工具栏(stype:'select')中使用任何选择元素,则应在searchoptions列表中包括以'eq'开头的sopt选项:例如,stype:'select', searchoptions: {sopt:['eq','ne']}.
  1. include ignoreCase:true to the jqGrid parameters
  2. include defaultSearch:'cn' option to the call of filterToolbar. For example: $("#list").jqGrid('filterToolbar', {defaultSearch:'cn'}).
  3. If you use any select elements in the searching toolbar (stype:'select') you should include in the list of searchoptions the sopt options which begin with 'eq': stype:'select', searchoptions: {sopt:['eq','ne']} for example.

这篇关于默认情况下在jqGrid中使用工具栏搜索在列的中间进行搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆