Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 TreeStore 填充来自 Json 的数据。我正在对其应用过滤器。
if ( !filter.filterFn(node) ) { node.remove(); }
对于第一次搜索尝试,一切正常,但在第二次尝试中,并非所有数据都用于搜索。为了使用所有数据,我需要为存储执行 .load() 。但在这种情况下,将发送对服务器的请求并应用过滤器。有没有办法实现这种行为?
我不确定我是否完全遵循您的问题,但我认为您想在应用新过滤器之前删除早期的过滤器。
您可以在调用之前添加一行以添加过滤器。
像这样的东西:
yourTreeStore.filters.clear();
(您要添加过滤器yourTreeStore的参考在哪里)Ext.data.TreeStore
yourTreeStore
Ext.data.TreeStore