jqgrid - Free-jqGrid:根据自定义选择的操作数动态设置搜索输入
问题描述
我正在使用免费的 jqgrid,我使用“customSortOperations:{}”实现了自定义搜索操作数,当我选择一个自定义操作数时,我想将搜索字段输入更改为选择,有没有办法做到这一点?if not is there an event that fires when the operand is chosen to listen for it and implement my custom search field change? 这是我如何使用“customSortOperations:{}”的示例
$.extend($.jgrid.defaults, {
customSortOperations: {
tst: {
operand: "T",
text: "Test",
}
},
});
解决方案
您只发布了代码的一小段。因此,我不确定我是否完全理解您的问题。要使用新的自定义搜索操作数,您应该在 中定义filter
方法并将列定义中customSortOperations.tst
的操作包含"tst"
在. 如果要将新操作用作默认搜索操作,则该操作应该是数组中的第一个操作。有关更多详细信息,请参见为旧答案创建的例如https://jsfiddle.net/OlegKi/f3gLde6m/2/。searchoptions.sopt
colModel
"tst"
"tst"
searchoptions.sopt
推荐阅读
- c - 为什么我的计算器程序不能计算运算符 / aka。划分正确吗?
- ruby - 红宝石。将字符串拆分为单独的十进制数字
- docker - 无法在 docker-compose 中运行 pihole
- c++ - 如何遍历存储在单独变量中的数字?
- python - python模块安装错误退出状态1
- powershell - Enable-RemoteMailbox - 从 CSV 或 TXT (PowerShell) 为一批用户设置 o365 Exchange Online Hybrid
- amazon-web-services - 如何将我的新域从 domain.com 映射到 AWS Elastic Beanstalk
- django - 如何使用 ForeignKeys ond 新 id 导入 dajngo 模型?
- php - 自然语言处理的正则表达式“不包含”模式问题
- python - pandas + python 列中最后 3 个值中的模式序列