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

Incorrect indetermined state when filtered

3 Answers 62 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Hello
Top achievements
Rank 1
Hello asked on 10 Aug 2017, 12:30 PM

Let's say we have this tree: A -> B -> [C,D]  where A = root node, B = childnode of A, nodes C and D are children of B).

When I check node C or D without filters applied, nodes A and B get the indeterminate state correctly. 

However, when I apply a filter (i.e. text contains C), node D get's hidden. When I now check node C, both nodes A and B also get checked, while they should be indeterminate since node D is not checked.

Using Kendo UI version 2017.2.621, OS Windows 10, Chrome 59.0.3071.115 (64-bit), jQuery version 1.12.4

Attached files:

  • Initial state
  • Checked C with filter applied
  • Removed filter with C being checked (incorrect indeterminate state for A and B)
  • Expected result (after removing filter, but should also have indeterminate state when filtering is still applied)

3 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 14 Aug 2017, 10:50 AM
Hello,

We are not sure what nodes showing/hiding logic you use when filtering the TreeView, however here's a dojo example in which the parent node has a indeterminate state correctly applied when only one of its children is checked. Search for the node with text "aaa" for instance. "bbb" and "ccc" will be hidden and if you check "aaa" its parent "child1" and the root node ("Root1") state will change to indeterminate not to checked.

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Hello
Top achievements
Rank 1
answered on 14 Aug 2017, 11:14 AM

Hello Ivan,

I am using the DataSource.filter function to apply filtering to the data. I expected the TreeView to understand the difference between filtered data and unfiltered data, but that doesn't seem the case.

0
Ivan Danchev
Telerik team
answered on 16 Aug 2017, 08:44 AM
Hello,

Indeed, as opposed to hiding nodes, when filtering them through the dataSource's filter method the nodes that are filtered out (not displayed) are not counted on determining the parent node's status (checked/unchecked/indeterminate).

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TreeView
Asked by
Hello
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Hello
Top achievements
Rank 1
Share this question
or