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

Load child nodes every time on expand

4 Answers 16 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Harpreet
Top achievements
Rank 1
Veteran
Harpreet asked on 11 Feb 2021, 01:25 PM

Hi All,

I need to load treelist child items every time when I click on expand icon, so achieve this I did the following thing, but the issue is the data is not refreshing in the treelist as it is showing the old data which loaded first time.

 

function onExpand(e) {       
        var treelist = $("#treelist").data("kendoTreeList");
        treelist.dataItem(e.model).loaded(false);
    }

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 15 Feb 2021, 12:34 PM

Hello Harpreet,

I suggest using achieving the desired in the Collapse event handler:

.Events(ev => ev.Collapse("onCollapse"))
...
<script>
    function onCollapse(e) {
        setTimeout(function () {
            e.model.loaded(false);
        })
    }
</script>

Let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Harpreet
Top achievements
Rank 1
Veteran
answered on 15 Feb 2021, 01:58 PM

Hi Nikolay,

The problem is still there, treelist is loading every-time on expand but the treelist is showing the old data.

Thanks

0
Harpreet
Top achievements
Rank 1
Veteran
answered on 17 Feb 2021, 10:36 AM

Hi Nikolay,

The above solution doesn't work for me.

So I worked around on this problem and found some other way to achieve the desired result.

 

Thank You.

0
Nikolay
Telerik team
answered on 17 Feb 2021, 11:51 AM

Helllo Harpreet,

You are most welcome. I am glad to hear you managed to resolve the situation.

Is it possible to share the solution you have came up with? As this thread is public I am sure this will be helpful to others facing the same scenario.

Regards,
Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
TreeList
Asked by
Harpreet
Top achievements
Rank 1
Veteran
Answers by
Nikolay
Telerik team
Harpreet
Top achievements
Rank 1
Veteran
Share this question
or