Clearing a Filter

Hi, Could someone point me towards documentation on how to clear any and all filters applied to a datatable, on the click of a button?
Thanks SrvrSide

Tagged:

Comments

  • edited March 2015

    You can try the code as follows

    dtable.eachColumn(function(id, col){
         var filter = this.getFilter(id);
         if (filter){
              if (filter.setValue) filter.setValue("")
              else filter.value = "";
         }
    });
    
  • Thank you very much. Having tried this, it obviously works as intended, but could you suggest how I would have the dataview redraw the columns as they should be presented now the filter is lifted?
    I (incorrectly) assumed dtable.refresh() or dtable.refreshColumns() would do the trick, but it seems not.
    Thank you SrvrSide

  • edited March 2015

    You can use

    $$("dtable").filterByAll(); 
    

    To reapply filters
    http://docs.webix.com/api__link__ui.treetable_filterbyall.html

  • Thank you very much.

  • Hi Maksim,

    Is there a way to check custom filters applied to the columns of data table and can be cleared on the button click?

    Regards,
    Kaleem B N

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!