带有网格刷新的jqgrid多选过滤器问题 [英] jqgrid multiselect filter issue with grid refresh
问题描述
我正在检查演示以在我的系统中实施多选过滤项目.
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.
过滤器未重置
有空的网格.
如何解决这些问题?任何的想法.
How can I fix these issues? Any Idea.
推荐答案
感谢您的错误报告! 代码行.稍后,我会将该错误报告给trirand.
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.
要解决此问题,必须使用filterToolbar
的beforeClear
回调:
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"
});
}
演示演示了解决方法.如果jqGrid中的错误将得到解决,则可以像beforeClear回调中删除第一行树. ="nofollow">演示.
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屋!