网格刷新的jqgrid多选过滤器问题 [英] jqgrid multiselect filter issue with grid refresh
问题描述
我正在检查 .我稍后会向 trirand 报告这个错误.
要解决这个问题,必须使用 filterToolbar
的 beforeClear
回调:
beforeClear: function () {$(this.grid.hDiv).find(".ui-search-toolbar .ui-search-input>select[多个] 选项").每个(函数(){//取消选择 <select> 中的所有选项this.selected = false;});$(this.grid.hDiv).find(".ui-search-toolbar button.ui-multiselect").每个(函数(){//将 jQuery UI 多选与 <select> 同步$(this).prev("select[multiple]").multiselect("refresh");}).css({宽度:98%",marginTop: "1px",marginBottom: "1px",paddingTop:3px"});}
演示演示了解决方法.如果 jqGrid 中的错误将得到解决,那么可以从 beforeClear
回调中删除第一行树,如 演示.
I was checking the demo to implement Multiselect filtering in my project.
It is a nice demo indeed but has some issues with it. Select a filter and hit the refresh button then filters are not resetting. And after that it will starts malfunctioning.
Select a filter:
After hitting refresh:
Filters are not resetting
Now unchecked the filter:
Got empty grid.
How can I fix these issues? Any Idea.
Thank you for the bug report! There are a bug in clearToolbar
in the lines of the code. I will report the bug later to trirand.
To fix the problem one have to use beforeClear
callback of filterToolbar
:
beforeClear: function () {
$(this.grid.hDiv)
.find(".ui-search-toolbar .ui-search-input>select[multiple] option")
.each(function () {
// unselect all options in <select>
this.selected = false;
}
);
$(this.grid.hDiv)
.find(".ui-search-toolbar button.ui-multiselect")
.each(function () {
// synchronize jQuery UI Multiselect with <select>
$(this).prev("select[multiple]").multiselect("refresh");
}
).css({
width: "98%",
marginTop: "1px",
marginBottom: "1px",
paddingTop: "3px"
});
}
The demo demonstrates the workaround. If the bug in jqGrid will be solved then one could remove the first tree lines from the beforeClear
callback like in the demo.
这篇关于网格刷新的jqgrid多选过滤器问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!