Change filterToolbar options dynamically(动态更改过滤器工具栏选项)
问题描述
有什么方法可以动态设置 'filterToolbar' 选项?
Is there any way that i can set 'filterToolbar' options dynamically?
这是我的问题.
最初我需要根据搜索选项的过滤器 -
'defaultSearch : "eq"
单击按钮后,我需要将搜索选项更改为 - defaultSearch : "cn"
after a button click i need to change the search option as - defaultSearch : "cn"
一种方法可以动态设置 defaultSearch 选项(我不知道天气是否可行),另一种方法是删除旧的 filtertoolbar 并添加新的 filtertoolbar 默认搜索为cn";.
one approach could be set the defaultSearch option dynamically ( i don't know weather it is possible) and other would be remove the old filtertoolbar and add the new filtertoolbar with the defaultsearch as "cn" .
jqgrid 可以做到这一点吗?请告诉我.感谢你的帮助.提前谢谢你.
is this possible with the jqgrid? please let me know. appreciate your help. Thank you in advance.
推荐答案
我觉得你的问题很有趣,所以在我 +1 之前.
I find your question interesting so before all +1 from me.
filtertoolbar的defaultSearch参数的值不能改变,但是可以动态改变:
You can't change the value of defaultSearch parameter of filtertoolbar, but you can change dynamically:
$("#list").jqGrid('setColProp','name',{searchoptions:{sopt:['cn']}});
在演示中客户端"中的初始搜索选项defaultSearch 定义的列,为cn".通过单击网格上方的两个按钮,您可以将选项更改为bw"(开头)或ew"(结尾).您可以在演示中轻松验证该方式是否有效.
In the demo the initial searching option in the 'Client' column defined by defaultSearch and is 'cn'. By clicking on two buttons above the grid you can change the option to 'bw' (begin with) or 'ew' (end with). You can easy verify on the demo that the way work.
这篇关于动态更改过滤器工具栏选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:动态更改过滤器工具栏选项
基础教程推荐
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
