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

3 posts, 1 answers
  1. Felix
    Felix avatar
    42 posts
    Member since:
    Sep 2014

    Posted 25 Mar 2015 Link to this post

    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. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 26 Mar 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Felix
    Felix avatar
    42 posts
    Member since:
    Sep 2014

    Posted 26 Mar 2015 in reply to Bozhidar Link to this post

    Hello Bozhidar,

    thanks for your reply. Works perfectly.

    Regards,
    Felix
Back to Top