内容简介:翻译自:https://stackoverflow.com/questions/4602505/jqgrid-how-to-hide-a-specific-search-field-in-the-search-toolbar
我正在使用jqGrid与搜索 工具 栏.现在有几列我不需要搜索字段,因为我不想让它们可搜索(即一列复选框).对于这些列,我想隐藏搜索工具栏中的搜索字段.
我在jqGrid documentation 中读到可查看选项可以设置为false.
这是我设置可查看选项的部分:
colModel :[
{name:'checkbox', index:'checkbox', width:'3%', viewable:false},
以下是我创建搜索工具栏的方法:
jQuery(function(){
jQuery("#listTable").jqGrid('filterToolbar',{stringResult: true, searchOnEnter: false});
});
根据 documentation ,只有在激活viewGridRow方法时,可查看选项才有效.
但是当我使用(激活)viewGridRow方法时,会创建另一个对话框.在该对话框中,不会显示其viewable设置为false的列.但我想在搜索工具栏中隐藏搜索字段而不是在新对话框中.我怎样才能做到这一点?
我还尝试获取相应的div(围绕我的搜索字段的div)并将其style.display设置为none.但这没有用.
有没有办法在搜索工具栏中隐藏此搜索字段?
在列模型中,为不希望搜索过滤器的列添加选项search:false.
例如:
{
label : 'User',
name : 'name',
width : 500,
sortable : false,
search : false
}
您可以找到文档 here .
翻译自:https://stackoverflow.com/questions/4602505/jqgrid-how-to-hide-a-specific-search-field-in-the-search-toolbar
以上所述就是小编给大家介绍的《javascript – jqGrid:如何隐藏搜索工具栏中的特定搜索字段》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Probability and Computing: Randomization and Probabilistic Techn
Michael Mitzenmacher、Eli Upfal / Cambridge University Press / 2017-7-3 / USD 62.23
Greatly expanded, this new edition requires only an elementary background in discrete mathematics and offers a comprehensive introduction to the role of randomization and probabilistic techniques in m......一起来看看 《Probability and Computing: Randomization and Probabilistic Techn》 这本书的介绍吧!