Need to set default values for table filter

edited June 13 in Technical questions

Hello Webix team,

I want to set predefined values for table filter. I have custom filter.

https://snippet.webix.com/hjvntlhw

I have tried using
webix.$$("grid").getFilter("section").setValue("contrib/kernel");
webix.$$("grid").filter("package","acx100-source",true);

but its not working.

Comments

  • edited June 13

    Hello @Tejal,

    You can set the value to the input as

    $$('grid').getFilter('id_of_column').value = 'some_value'
    

    and after that use filter

    Please check the sample: https://snippet.webix.com/0dyyw9xs

  • Good morning Nastja,

    I am trying to implement a similar function following your example above https://snippet.webix.com/0dyyw9xs. I define my value and see it in the box so I can filter but when I load page even though the value is in filter box the table still shows all values NOT filtered data. I can only get it to filter if I press the "Enter key" (carriage return)...Do you have any suggestions to solve my problem...I appreciate your feedback..thx

  • the example appears to work when setup standalone. My environment setting has Webix as the front dashboard (datatable view), thymeleaf and Java with boostrap buttons using "rest->". I ended up using the following to correct my problem: ready:function(){this.get.filter('instance').value = 'prod'; this.filter('instance','prod',true); refreshFilter('instance'); }.....the resfreshFilter line did the trick...otherwise the filter box had 'prod' in it but the filter action never took place....

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion