简体   繁体   English

重置Webix数据表过滤器

[英]Reset Webix datatable filter

I have a quite confusing question. 我有一个很困惑的问题。 I have a Webix datatable and trying to reset a filter ( richSelectFilter ) for a column. 我有一个Webix数据表,并尝试重置列的过滤器( richSelectFilter )。 But it's acting not as I've expected. 但这并不像我预期的那样。 I tried 我试过了

$$("table1").getFilter("title").config.value = "";        

But nothing happens. 但是什么也没发生。 Another attempt: 另一尝试:

$$("table1").getFilter("title").config.value = "";        
$$("table1").refreshColumns();

And filter was disappeared while values are still filtered! 当值仍然被过滤时,过滤器消失了!

Here's a short code snippet: http://webix.com/snippet/b34607aa 这是一个简短的代码段: http : //webix.com/snippet/b34607aa

Am I doing something wrong? 难道我做错了什么? Will appreciate any help. 将不胜感激。

Try to use 尝试使用

$$("table1").getFilter("title").setValue("");

Here's a snippet http://webix.com/snippet/3eb45109 这是一个代码段http://webix.com/snippet/3eb45109

While you code will be correct for normal richselect control, filters in a datatable store the actual values in the column's config object. 虽然您的代码对于正常的richselect控件是正确的,但数据表中的过滤器会将实际值存储在列的config对象中。 So you need to change it there, or just use the setValue API which will change value and will refresh the grid in the necessary way. 因此,您需要在此处进行更改,或者只使用setValue API,该API会更改值并以必要的方式刷新网格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM