Declined
Last Updated: 26 Oct 2020 10:01 by ADMIN
jovaughn
Created on: 12 Jun 2020 13:47
Category: TreeView
Type: Bug Report
0
TreeView parent node checkbox state is not properly updated (Core)

Bug report

Reproduction of the problem

  1. Run the attached sample project:
    TelerikAspNetCoreApp100.zip
  2. A child node is returned as checked from the server.
  3. Note the difference between the state of the parent node checkbox in the Core TreeView (incorrect) and in the Kendo UI TreeView (correct).

Current behavior

The parent node's state remains "unchecked".

Expected/desired behavior

The parent node's state should be "indeterminate".

Workaround:

Attach a DataBound event handler to the TreeView:

<kendo-treeview name="DataRestrictionTree" load-on-demand="false" datatextfield="Name" on-data-bound="onDataBound" >

In the handler call the TreeView's updateIndeterminate API method:

function onDataBound(e) {
	var treeview = $("#DataRestrictionTree").data("kendoTreeView");
	treeview.updateIndeterminate();
}

Environment

  • Kendo UI version: 2020.2.513
  • jQuery version: x.y
  • Browser: [all]
2 comments
ADMIN
Ivan Danchev
Posted on: 19 Jun 2020 11:27

Hello ,

I've tried this in the project attached to the bug report. I uncommented the workaround:

function onDataBound(e) {
	//Workaround:
	var treeview = $("#DataRestrictionTree").data("kendoTreeView");
	treeview.updateIndeterminate();
}

and set the first root node to Checked:

data.Add(new ViewModel
{
    ID = 1,
    Name = "Root1",
    Expanded = false,
    Checked = true
});

I did not observe the first node getting unchecked: screenshot.

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
jovaughn
Posted on: 12 Jun 2020 14:57

This work around does update the indeterminate check boxes correctly.

But, it seems to uncheck any root level checkbox that was and should be checked on load.

In my attached picture the first three root levels should be checked along with the 4th being indeterminate(which is correct in the picture).

Works fine either way in the jquery version but not in the asp.net version with remote date. jquery demo with update method

Attached Files: