This is a migrated thread and some comments may be shown as answers.

Datasource filter inconsistent

10 Answers 29 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Vedad
Top achievements
Rank 1
Iron
Veteran
Iron
Vedad asked on 04 Feb 2020, 11:52 AM
Hi, 

I implemented "dynamic" filtering on our gantt widget, which basically allows user to show/hide tasks under certain conditions. 

However, filter is behaving differently on two datasets (same service returns response under different conditions).

For example: I have 130 items in my datasource, out of which 63 has status not equal to 3, and I have following filter: 

{
  "filters": [
    {
      "field": "status",
      "operator": "neq",
      "value": 3
    }
  ]
}

After I apply filter, result is not 63 items displayed, but approx 100, where obviously some don't meet criteria (have status 3).
If I load a different project and apply the same filter, for the same filter it rules out all items, and widget is empty.

Strange thing is that at the same time, filter based on object type (we have property in datasource realObjType) works normally for both datasets.

{
  "filters": [
    {
      "field": "realObjType",
      "operator": "neq",
      "value": 7
    }
  ]
}

I compared responses, and they have identical structure, fields we are filtering are in same and correct type.
Only obvious difference between two project is in number of items. 

I would appreciate a suggestions, as we have a some time pressure.

Thanks and best regards, 
Vedad

10 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 06 Feb 2020, 09:47 AM

Hi Vedad,

If you observe different behavior when using the same filter but different data, then the data is the place to look at for a possible cause. For instance, since you are filtering based on the "status" field, do all tasks in the data (especially summary tasks) have this field? Lets say you have 10 child tasks that are under a single summary task. If that summary task does not not match the filter criteria, for example if its status value is 3, then regardless of what the statuses of the child tasks are nothing will be displayed in the Gantt, because the parent task is filtered out and along with it the child tasks.

If you are unable to find any issue with the data, please post your Gantt configuration along with some exemplary JSON data that resembles the second dataset you mentioned. We will give it a try at our end and check how it is filtered.

Regards,
Ivan Danchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vedad
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 06 Feb 2020, 10:59 AM

Hi Ivan, 

thanks for the prompt response.

I doubt data as well, but I cannot see difference between two data sets except values.

Summary tasks also crossed my mind first, but it doesn't seem to be problem in overall picture. I will provide you with simplified example.

I have other filters as well which don't act as expected. I will provide you with the screenshot of data structure, file with datasource data and filter configuration we use. Unfortunately I cannot provide you with complete functional gantt configuration as it has a lot of other logic and methods required by our system). 

Let me try to prepare example and I will post another message.

Thanks again,

Vedad

 

0
Ivan Danchev
Telerik team
answered on 10 Feb 2020, 09:34 AM

Hi Vedad,

If you are unable to provide a runnable example at this time, could you post some exemplary data that is loaded in the Gantt? For example here's how part of the data bound to the Gantt in our demos looks like:

[
	{"TaskID":7,"ParentID":null,"Title":"Software validation, research and implementation","Start":"\/Date(1401667200000)\/","End":"\/Date(1405123200000)\/","Summary":true,"Expanded":true,"PercentComplete":0.43,"OrderId":0},
	{"TaskID":11,"ParentID":7,"Title":"Research","Start":"\/Date(1401667200000)\/","End":"\/Date(1402099200000)\/","Summary":true,"Expanded":true,"PercentComplete":0.43,"OrderId":1},
	{"TaskID":12,"ParentID":7,"Title":"Design","Start":"\/Date(1402272000000)\/","End":"\/Date(1402704000000)\/","Summary":true,"Expanded":true,"PercentComplete":0.60,"OrderId":2},
	{"TaskID":13,"ParentID":7,"Title":"Implementation","Start":"\/Date(1402444800000)\/","End":"\/Date(1404259200000)\/","Summary":true,"Expanded":true,"PercentComplete":0.77,"OrderId":3}
]

Could you check the response from the service and extract a similar set of tasks data that is not filtered as expected?

Additionally, post the problematic filters and we will check how the sample data is filtered with them.

Regards,
Ivan Danchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vedad
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 12 Feb 2020, 03:19 PM

Hi Ivan, 

thank you for your help. I found the reason for this pointless behaviour. It was indeed data which was broken in one case, due to language differences.

I apologise for wasting your time, and thanks again.

Regards, 

Vedad

0
Ivan Danchev
Telerik team
answered on 14 Feb 2020, 09:59 AM

Hi Vedad,

Thank you for the follow up. I am glad the issue in the data has been identified.

Regards,
Ivan Danchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vedad
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 05 Mar 2020, 09:38 AM

Hi Ivan, 

I am writing at this thread, because its somehow related. 

Is there any way to filter on child level of data.
Currently if parent is to be filtered out due to condition, children get filtered out as well.

Is there any way to leave parent out of equation and if children is to be visible, then parent stays visible even though it should be filtered out.

Thanks

0
Ianko
Telerik team
answered on 06 Mar 2020, 01:17 PM

Hello Vedad,

I assume you are referring to the GanttDataSource. I am afraid filtering only children is not possible. The data is not hierarchical, but a linear one and only simulates hierarchy by using the parent property of the items. 

This, however, is a request that is already logged in our feedback portal: https://feedback.telerik.com/kendo-jquery-ui/1443358-gantt-filtering. You can vote and/or add comment to the item. Or just follow it for future updates.

Regards,
Ianko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vedad
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 06 Mar 2020, 01:25 PM

Hi Ianko, 

thanks for the prompt answer as usual. I upvoted request you pointed out, but it is flagged as "unplanned", so I am afraid this is a long shot. 

I had idea of doing excluding "parental" items via condition, but when I think about it, I have feeling this may turn out to be very complex filter. Do you by any chance have example or suggestion how to approach this?

Thank you, regards,

Vedad

0
Ianko
Telerik team
answered on 06 Mar 2020, 02:03 PM

Hi Vedad,

A possible way to accomplish such a filter is to have two filters: one with the desired filter and one that checks if parentId is null. This however, will show all root items. Here you are a dojo example: https://dojo.telerik.com/ohOpUBUL/3

Regards,
Ianko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vedad
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 06 Mar 2020, 02:43 PM

Hi Ianko, 

great, this is what i had in mind. I can live with root items being shown al the time.

Thank you very much.

Regards,

Vedad

Tags
Data Source
Asked by
Vedad
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Ivan Danchev
Telerik team
Vedad
Top achievements
Rank 1
Iron
Veteran
Iron
Ianko
Telerik team
Share this question
or