问题描述
有什么方法可以动态设置 '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.
这篇关于动态更改过滤器工具栏选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)