Kendo-angular: Treeview: Checkbox item does not render correctly (missing square)

Created on 18 Jan 2018  路  6Comments  路  Source: telerik/kendo-angular

I'm submitting a...

  • Bug report

Current behavior

When child item is checked, parent item does not render red square:
chrome_2018-01-18_16-26-04

Expected behavior

Square is checked

Minimal reproduction of the problem with instructions

Run this plunkr.
Open Item 2 or Item 3.
Check one of item 2.1, 2.2, 3.1, 3.2.
chrome_2018-01-18_16-28-13

Browser:

  • Chrome (desktop) version XX
Question treeview

All 6 comments

Hi @MaklaCof,
As it is stated in the documentation, the indeterminate state is not applied when different than hierarchical id key is used. Basically, the built-in check directive will look into the hierarchical structure to apply the indeterminate state.

https://www.telerik.com/kendo-angular-ui/components/treeview/checkboxes/#toc-multiple-check-mode

If you would like to support both check and indeterminate state then you will need to implement a custom isChecked callback that will determine whether the parent has checked children.

Use this custom check directive as a base for the future custom implementation:

https://www.telerik.com/kendo-angular-ui/components/treeview/checkboxes/#toc-modifying-the-checked-state

@ggkrustev
Hi, isChecked would work for me, but it is not working. Not in my case. Problem is isChecked is never called if kendoTreeViewCheckable directive is added to treeview. But without kendoTreeViewCheckable directive I can not set checkedKeys.

If I think logicically isChecked should work (maybe only) when kendoTreeViewCheckable directive is set. But not only when directive is not set. So I would call it a bug, but I am not sure.

Here is plunkr.
First example in plunkr uses kendoTreeViewCheckable and call isChecked is never execute.
Second example doesn't have 'kendoTreeViewCheckable', isChecked is called, but I can not set checkedKeys.

@MaklaCof, indeed the passed isChecked function will be overridden by the CheckDirective built-in callback. Defining a custom isChecked logic, even though kendoTreeViewCheckable directive is applied, definitely, should be possible.

I can confirm that we will address this limitation in the next release of the component.

The latest DEV release includes a fix for the isChecked callback. Please give it a try and let us know if the problem still persists.

  • v1.1.0-dev.201801241312

Version 1.1.0 is out. Will close the thread as resolved.

It works.

Was this page helpful?
0 / 5 - 0 ratings