We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Filtering on Hierarchy Grid

Hi,
Tiere is a way to filter data with the method filtercolumn on subgrids columns?
I tried to use the method provided, but seems to work only on the first level (if I put a column in the filter that doesn't appear in the list of columns there is an exception)

Also where can I find a list of the valid predicates for the method? In the documentation there in only the "equal" value.

Another question there is a Grid Object for each expanded level or the Object is only the First level of grid?

Thanks in advance

    Andrea Perazzolo


6 Replies

AS Alan Sangeeth S Syncfusion Team January 15, 2015 07:15 AM UTC

Hi Andrea,

Thanks for using Syncfusion Products.

Query 1: “is there a Grid Object for each expanded level or the Object is only the First level of grid & way to filter data with the method filtercolumn on subgrids columns”

We have Grid object for each child grid and using the child Grid object we can filter columns in Child Grid using “filterColumn” Grid method. Please refer the following code snippets.

var childObj = $("#child1_grid1").ejGrid("instance") // child1_grid1 is the id of child grid

childObj.filterColumn("ShipCity", ej.FilterOperators.startsWith, "Port", "and",true)

Query 2: “where can I find a list of the valid predicates for the method? In the documentation there in only the "equal" value”

Please refer the following documentation for details regarding Grid filtering. Under the ‘Filter Operators’ section in below documentation link you can find the list of filter operators.

http://help.syncfusion.com/ug/js/documents/filtering1.htm

Please let us know if you need any further assistance.

Regards,
Alan Sangeeth S




AP Andrea Perazzolo replied to Alan Sangeeth S January 15, 2015 08:17 AM UTC

Hi Andrea,

Thanks for using Syncfusion Products.

Query 1: “is there a Grid Object for each expanded level or the Object is only the First level of grid & way to filter data with the method filtercolumn on subgrids columns”

We have Grid object for each child grid and using the child Grid object we can filter columns in Child Grid using “filterColumn” Grid method. Please refer the following code snippets.

var childObj = $("#child1_grid1").ejGrid("instance") // child1_grid1 is the id of child grid

childObj.filterColumn("ShipCity", ej.FilterOperators.startsWith, "Port", "and",true)

Query 2: “where can I find a list of the valid predicates for the method? In the documentation there in only the "equal" value”

Please refer the following documentation for details regarding Grid filtering. Under the ‘Filter Operators’ section in below documentation link you can find the list of filter operators.

http://help.syncfusion.com/ug/js/documents/filtering1.htm

Please let us know if you need any further assistance.

Regards,
Alan Sangeeth S



Hi,
i tried your code, but in my application the new grid object is empty and not a Grid Object
My Principal Grid has ID = "MacroAreas",
so i tried "child1_MacroAreas",  "child1_macroareas", "child1_grid1" etc.

Maybe I missed to set something in the MVC Helper ChildGrid.

For the other levels, the prefix will be child2_ child3 etc or what?

Could you please provide a working example?

     Thanks in advance

   Andrea Perazzolo


AP Andrea Perazzolo January 15, 2015 09:05 AM UTC

Hi,
I was able to retrieve the grid objects and call the filtercolumn method.
I noticed that the filtering does not work if the FilterSettings Type is set to Excel, but works correctly in Menu and FilterBar mode.
Is it normal or a bug?

   Thanks in advance

   Andrea Perazzolo


AP Andrea Perazzolo January 15, 2015 09:07 AM UTC

Hi,
Another problem maybe you are already correcting.
In the subgrids Filterbar all the textboxes are shifted by one column.

Andrea Perazzolo


AP Andrea Perazzolo January 15, 2015 10:47 AM UTC

Hi,
sorry to continue bother you.
With the filtercolumn method how can I  clear all the filters applied without reloading the grid?

   Thanks

   Andrea Perazzolo


AS Alan Sangeeth S Syncfusion Team January 19, 2015 01:56 PM UTC

Hi Andrea,

Thanks for the update.

Query 1: “filtering does not work if the FilterSettings Type is set to Excel &  Filterbar textboxes are shifted by one column”

We are able to reproduce the issues “Filter method not working with Excel Filter” & “Filterbar alignment issue in Hierarchy Grid” and we have logged defect report for this. We have created a support incident under your account to track the status of this requirement. Please log on to our support website to check for further updates

Query 2: “how can I  clear all the filters applied”

We suggest you to empty the filteredColumns array of “filterSettings” Grid property and then refresh Grid Content to achieve your requiremnent. Please refer the following code snippets.

  var obj = $("#Grid").ejGrid("instance");

    obj.model.filterSettings.filteredColumns = [];

    obj.refreshContent()

Please let us know if you have any queries.

Regards,
Alan Sangeeth S



Loader.
Up arrow icon