ScrollToDateTime

5 posts, 0 answers
  1. Druoton
    Druoton avatar
    4 posts
    Member since:
    Jul 2014

    Posted 27 Jun Link to this post

    Hi Telerik Team, you are doing an amazing work but today I need some more information.

     

    I need to focus the gantt view on a task while double clicking on its name.

    I look forward something like the "ScrollToDateTime" function or something like that.

    I already tried this solution : http://www.telerik.com/forums/scroll-to-current-day but it could not find the ".bind" property of the "._widget".

     

    I also need to directly open a popup after the insertion of a new task. The problem is that I can't find the task ID in the OntaskInsert event.

     

    Could you please help me ?

  2. Plamen
    Admin
    Plamen avatar
    2730 posts

    Posted 30 Jun Link to this post

    Hi,

    I have tested the code from the forum linked and it worked correctly at my side. At your side you are most probably not finding the Gantt object correctly.
    Here is the similar code that helped me open the edit form immediately:
    function pageLoad() {
                   $find("RadGantt1")._widget.bind("dataBound", ganttDataBound);
                   $find("RadGantt1")._widget.bind("add", add);
               }
               var flag;
               function add(e) {
                   flag = e.task.uid;
               }
     
               function ganttDataBound(e) {
                   var view = $find("RadGantt1")._widget.timeline.view();
                   var viewStart = view.start;
                   var viewEnd = view.end;
                   var currentDate = new Date();
     
                   if (flag) {
                       e.sender.editTask(flag);
                       flag = false;
                   }
               }

    Hope this will help you solve the issue.

    Regards,
    Plamen
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Druoton
    Druoton avatar
    4 posts
    Member since:
    Jul 2014

    Posted 05 Jul Link to this post

    Hi Plamen,

    You are right, I was not finding the gantt object correctly.
    If I try to access to the "_widjet" object outside of the "ganttDataBound" event, it is not working.

    So, here is my question :
    How could I do to use the "$find("RadGantt1")._widget.timeline.view();" then the "view.content.scrollLeft(offset);" from the code behind using the ScriptManager.RegisterStartupScript ?

    I need to change the view of the gantt from a click on a button for instance.

     

    Thank you for you help.

  5. Plamen
    Admin
    Plamen avatar
    2730 posts

    Posted 07 Jul Link to this post

    Hi,

    In such case we would rather recommend to change the view on the server side as in the code below:
    protected void Unnamed_Click(object sender, EventArgs e)
        {
            RadGantt1.SelectedView = Telerik.Web.UI.GanttViewType.WeekView;
        }

    and provide the scroll in the pageLoad client event after that. Hope this will help you solve the issue.

    Regards,
    Plamen
    Telerik by Progress
  6. Druoton
    Druoton avatar
    4 posts
    Member since:
    Jul 2014

    Posted 08 Jul Link to this post

    Hi Plamen,

     

    I made what I wanted to do with your solution.

     

    Thank you very much for your help.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017