Checkboxes below the expanded node lose their state

2 posts, 0 answers
  1. Adam Strach
    Adam Strach avatar
    1 posts
    Member since:
    Jul 2018

    Posted 08 Sep 2018 Link to this post



    I'm using the MVC TreeList with remote data loading.I have the latest column to be a checkbox, but I have an issue when the node is expanded. After expanded, all of the nodes below in the same tier get unchecked, even if they were checked before that. Here is a video of the problem.

    Am I doing something wrong?

    This is the code for the tree list:

                                                                                                    .Columns(columns =>
                                                                                                        columns.Add().Field(e => e.Value.Id).Width(280).Title("ORG ID");
                                                                                                        columns.Add().Field(e => e.Value.Name).Width(280).Title("ORGANIZATION NAME");
                                                                                                        columns.Add().Field(e => e.Value.ActiveFlag).Width(60).Title("ACTIVE");
                                                                                            .DataSource(dataSource => dataSource
                                                                                                .Read(read => read.Action("OrganizationsTree_Read", "Home"))
                                                                                                .Model(m =>
                                                                                                    m.Id(f => f.Id);
                                                                                                    m.ParentId(f => f.ParentId).DefaultValue(null);
                                                                                                    m.Field(f => f.Value.Id);
                                                                                                    m.Field(f => f.Value.ParentId);
                                                                                                .Events(events => { events.DataBound("onTreeDataBound"); events.Expand("onTreeExpand"); })


    DataBound and Expand are JS methods without any code except console.log(arg).


    Thank you

  2. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 11 Sep 2018 Link to this post

    Hi Adam,

    For others with similar issue, I am sharing the answer from the support ticket that you have opened:

    "Although that the code for the template with the checkbox is missing in the code snippet, I would guess that there is no two-way binding between the dataItem and the checkboxes, which means that each time a node is expanded or collapsed, all records after the expand/collapse point will be rendered again with the value present in the underlying dataItem (the initial value) or the initial template. This is the expected behavior and there is no suitable solution that we could recommend.

    Nevertheless, you could take a look at the following HowTo example and re-use the client-side logic for persisting the checked state of the checkboxes: "

    Best Regards,
    Konstantin Dikov
    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.
Back to Top