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

ASP.NET AJAX pageLoad()-method is not called if a task will be collapsed

2 Answers 386 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Felix
Top achievements
Rank 1
Felix asked on 25 Mar 2015, 03:04 PM
Hello,

I'm using the ASP.NET AJAX pageLoad()-method inside my javascript to attach e.g. a click event to a task of the gantt control. But it seems that this pageLoad()-method will not be invoked anymore if I collapse a task. And even if I expand that task again, the pageLoad()-method inside my javascript-code is not called anymore, too. The $(document).ready()-function is not working in my case because I add a special css-class as a bookmark to attach the click-event and this must happen on every page load. I hope you can help me.

Regards,
Felix

2 Answers, 1 is accepted

Sort by
0
Accepted
Bozhidar
Telerik team
answered on 26 Mar 2015, 08:27 AM
Hello,

The expand/collapse feature of the gantt control is purely a client feature, that doesn't trigger any postback or callback. This is why the pageLoad function is not called.

If you want to bind to an event after the html of the gantt is refreshed, you can use the following:
function pageLoad() {
    var gantt = $find("RadGantt1");
 
    gantt._widget.bind("dataBound", function() {
        console.log("refreshed");
 
        // Any code in here will be called when the gantt is refreshed
    });
}


Regards,
Bozhidar
Telerik
0
Felix
Top achievements
Rank 1
answered on 26 Mar 2015, 10:01 AM
Hello Bozhidar,

thanks for your reply. Works perfectly.

Regards,
Felix
Tags
Gantt
Asked by
Felix
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Felix
Top achievements
Rank 1
Share this question
or