EXTjs gridfilter:如何在不重新加载商店的情况下清除过滤器? [英] EXTjs gridfilter: How to clearfilter without reloading store?
问题描述
在 extjs GridFilters 中,有没有办法在不重新加载商店的情况下清除过滤器?
这是要求:
网格下方有一个网格(#1)和另一个网格(#2).网格(#1)有一个 id 列表,当点击一个特定的 id 时,网格(#2)会填充一个属于该 id 的记录列表.
示例可能是:grid#1: list of all maangers
网格#2:特定经理的所有员工列表.
In extjs GridFilters, is there a way to clear the filters without reloading the store?
This is the rquirement:
There is a grid(#1) and another grid(#2) below the grid. The grid(#1) has a list of ids, and when a particular id is clicked, the grid(#2) is popualted with a list of records that belong to that id.
And example might be:grid#1: list of all maangers
grid#2: list of all employees for a particular maanger.
网格 #2 有一个过滤器:员工姓名.
Grid #2 has a filter: on employee name.
rqmt 是:当网格#1 中的选择更改时,清除所有旧过滤器,但不要重新加载网格 #2 的存储,因为网格#2 存储将通过另一个函数加载.
The rqmt is: When a selection is changed in grid#1, clear all the old filters, but do not relaod the store for grid #2 as grid#2 store will be loaded through another function.
请告诉我如何通过提供更多信息来提供帮助
Please let me know how I can help by providing more info
推荐答案
经过一些 Firebug 步骤后,我发现这很有效.
After some Firebug stepping, I found this works quite well.
var store = this.getStore();
store.remoteFilter = false;
store.clearFilter();
store.remoteFilter = true;
store.filter(...);
remoteFilter
似乎不是记录的属性,但它会在设置为 false
时暂停 xhr 调用.
remoteFilter
does not seem to be a documented property, but it will suspend xhr calls while it's set to false
.
当你设置remoteFilter
为false时,当clearFilter()
被调用时,load()
函数被跳过.
When you set remoteFilter
to false, when clearFilter()
is called, the load()
function is stepped over.
这篇关于EXTjs gridfilter:如何在不重新加载商店的情况下清除过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!