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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Filtering subtasks with ej.Query

Thread ID:

Created:

Updated:

Platform:

Replies:

142142 Jan 22,2019 08:05 AM UTC Jan 23,2019 11:45 AM UTC Angular 1
loading
Tags: ejGantt
oscar bartolome
Asked On January 22, 2019 08:05 AM UTC

Hi,

I want to filter my data by some properties, so I use ejQuery's where clause to do it. Like this:

me.query = new ej.Query().where(new ej.Predicate("prod_order_reference", ej.FilterOperators.contains, $('#filterHighlightTextOp').val(), true)
.or("item_reference", ej.FilterOperators.contains, $('#filterHighlightTextOp').val(), true)
.or("item_name", ej.FilterOperators.contains, $('#filterHighlightTextOp').val(), true)
.or("customer", ej.FilterOperators.contains, $('#filterHighlightTextOp').val(), true)
.or("sale_order", ej.FilterOperators.contains, $('#filterHighlightTextOp').val(), true));

Doing it this way it only filters the first level of the data structure, but it doesn't filter the subtasks of a task. 
For example, in the ej.Predicate, it first check the if "prod_order_reference" property contains a value. I want to check this in the parent task and in every child subtask, but it does only in the parent one.

How could I do this?

Thanks.

Jayakumar Duraisamy [Syncfusion]
Replied On January 23, 2019 11:45 AM UTC

Hi Oscar, 
We have analyzed the reported query.  The reported issue may due to applying “ej.Query()” on a hierarchical data. To filter all the required records, we recommend self-reference data source. And using “filterSettings” property we can filter required columns on load time. 
Please find the code example below: 
[ts] 
this.filterSettings = { 
                       filteredColumns: [{ 
                           value: "5", 
                           field: "TaskName", 
                           operator: "contains", 
                            predicate: "or" 
                       }, 
                      { 
                        value: "1", 
                        field: "TaskName", 
                        operator: "contains", 
                        predicate: "or" 
                    }] 
                   } 
 
[html] 
<ej-gantt id="GanttControl"  
       //.. 
[filterSettings]="filterSettings"> 
</ej-gantt> 
 
We have also prepared the sample based on this. Please find the sample from below location 
 
Please let us know if you need further reference on this. 
Regards, 
Jayakumar D 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;