9 Answers, 1 is accepted
Hello Ivo,
This behavior is intended, see the quote from the event documentation: "Fired when an item is about to be expanded."
The reason for this is that the event can be prevented.
Regards,
Nikolay Rusev
Telerik

Hello Ivo,
The following example demonstrates a way to achieve this - http://dojo.telerik.com/@rusev/EGUTI
Regards,Nikolay Rusev
Telerik

Thank you very much.
But I also found, that, "expanded" event is triggered only by clicking on the "expand" icon. TreeList.expand() function does not trigger the event. Is this also intentional or a bug and is there a work around?
The fact is that when I click - the example above work. When call TreeList.expand() - it does not.
regs
Ivo
Hello Ivo,
Yes, the API method will not trigger the event. You should be able to execute the logic for checking model state right after you call expand API.
Regards,
Nikolay Rusev
Telerik

Unfortunately this is not the case, as I want to select (again with an api method) a row that is in the newly loaded with the expand rows. And of course they load asynchr. I found a workaround with the DataBound event... but its a dirty workaround :)
I saw in some other posts that there was a similar case with Menu expand event which was considered a bug. Would this also be considered as a bug and be fixed soon?
Thanks
Hello Ivo,
I'm not sure I fully understand the scenario which you described. Can you please simulate it in the dojo example from my previous posts?
Regards,
Nikolay Rusev
Telerik

There is no "activate" event exposed by the TreeList. In case you want to find out when an item has been expaded, use the approach provided above that attaches a one-time dataBound handler when an item is about to be expanded.
http://dojo.telerik.com/@rusev/EGUTI
Regards,
Dimo
Telerik
Hello, Dan,
I'll share the response from the ticket here as well, in case anybody else has the same question. In order to emulate an "afterExpand" and "afterCollapse" events, you can use setTimeout to delay the execution of the logic.
expand: function() { setTimeout(function(){ // Custom code here will be executed after the row has been expanded. }); }
Best Regards,
Georgi