Is there a way the get the filter condition

In Vue Data Grid control, can I get the filter conditions the user entered?



3 Replies

BS Balaji Sekar Syncfusion Team April 28, 2020 07:04 AM UTC

Hi John, 
 
Greetings from the Syncfusion support, 
 
Query: Can I get the filter conditions the user entered? 
 
In the Grid, we provided a support filtering Menu and Excel. Column level can be filtered with condition basis. As we recommend that you see our Demo Sample Menu and Excel Filtering and Documentation to help. 
 
 
 
Please get back to us if you need to further assistance. 
 
Regards, 
Balaji Sekar 



JC John Chen April 28, 2020 12:27 PM UTC

I may not stated my question clearly.

What I need to know is how to retrieve the criteria the use entered in the filters.

For example, user enters {ID equal 1}, {Name contains 'ABC'}. I want use the same criteria for other things but I only know the filtered result.


BS Balaji Sekar Syncfusion Team April 29, 2020 10:39 AM UTC

Hi John, 
 
As per your query, we can get the filtered columns details from filterSettings.columns in the Grid component. Please refer the below code example and sample for more information. 
 
[App.Vue] 

filteredRecord: function() { 
      var grid = document.getElementById("Grid").ej2_instances[0]; 
      var filteredItems = []; 
      grid.filterSettings.columns.forEach(item => 
        filteredItems.push(item.properties) 
      ); 
      console.log(filteredItems); 
    }, 
filterAction: function() { 
      this.$refs.grid.filterByColumn("CustomerID", "startsWith", "VINET"); 
      this.$refs.grid.filterByColumn("OrderID", "equal", 10248); 
    }, 
 
 

Please get back to us, if you need further assistance. 

Regards, 
Balaji Sekar 


Loader.
Up arrow icon