Client event double click task

10 posts, 0 answers
  1. OfficeHeart
    OfficeHeart avatar
    99 posts
    Member since:
    Aug 2008

    Posted 23 Sep 2014 Link to this post

    Hello,

    Is it possible to attach a eventhandler to a double click event on a task and get the taskId?

    Thanks,
    Martin
  2. Bozhidar
    Admin
    Bozhidar avatar
    1189 posts

    Posted 24 Sep 2014 Link to this post

    Hello Martin,

    You can attach a double click event handler manually and implement your logic there. Here's an example of how to get a task from inside a double click handler:
    function pageLoad() {
        var $ = $telerik.$;
        var gantt = $find("RadGantt1");
     
        $(".rgtTask").on("dblclick", function(e) {
            e.stopPropagation();
     
            var $element = $(e.target);
     
            if (!$element.is(".rgtTask")) {
                $element = $element.parents(".rgtTask").first();
            }
     
            var uid = $element.attr("data-uid");
            var tasks = gantt.get_allTasks();
            var task;
     
            for (var i = 0; i < tasks.length; i++) {
                if (tasks[i]._uid === uid) {
                    task = tasks[i];
                    break;
                }
            }
     
            console.log(task);
        });
     
    }


    Regards,
    Bozhidar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. André
    André avatar
    1 posts
    Member since:
    Oct 2014

    Posted 29 Oct 2014 in reply to Bozhidar Link to this post

    this exemple return taskid not value column id. have to return the value of the id column of the selected row?
  4. Хосбаяр
    Хосбаяр avatar
    8 posts
    Member since:
    Jun 2013

    Posted 15 Jan 2015 Link to this post

    Trying get task id. Telerik version 2014 Q3

    Cannot read property 'get_allTasks' of null 

  5. Bozhidar
    Admin
    Bozhidar avatar
    1189 posts

    Posted 16 Jan 2015 Link to this post

    Hi,

    Can you share your code (just the relevant part, demonstrating the Gantt and how you're using it), so that we can inspect it in order to find out why you might be getting this error.

    The most probable cause is that the following line is not getting the proper reference to the Gantt control:
    var gantt = $find("RadGantt1");

    This might be caused by several reasons:
    1. Your Gantt has a different ID
    2. Your Gantt is inside a naming container, causing its client ID to be different than the one specified in the markup. In this case try using the following syntax:
    var gantt = $find("<%= RadGantt1.ClientID %>");


    Regards,
    Bozhidar
    Telerik
  6. Хосбаяр
    Хосбаяр avatar
    8 posts
    Member since:
    Jun 2013

    Posted 16 Jan 2015 Link to this post

    Hello Bozhidar thank you for answering. previously error my bad  "different ID" . 

    now when i try new task or all postback actions give me error:

    Server Error in '/' Application.
    The state information is invalid for this page and might be corrupted

    Database from 
    http://www.telerik.com/help/aspnet-ajax/gantt-data-binding-database-structure.html

    Binding like 

    http://www.telerik.com/help/aspnet-ajax/gantt-data-binding-declarative-binding.html



  7. Bozhidar
    Admin
    Bozhidar avatar
    1189 posts

    Posted 19 Jan 2015 Link to this post

    Hi,

    When you have new and different issues, please post them in a new forum thread (or in an old one discussing the particular issue), so that we can keep each forum thread concise and relevant to it's title. That way when another person searches through the forum he can more easily find a relevant topic.

    As for the issue at hand, again, without relevant code there's little we can say about the problem. Also, make sure you are using the official release of RadGantt (Q3 2014), rather than the beta release (Q2 2014), since there were some issues concerning databinding and CRUD operations that were addressed between the two versions.
     
    Regards,
    Bozhidar
    Telerik
  8. bassam
    bassam avatar
    14 posts
    Member since:
    Feb 2020

    Posted 12 Mar in reply to Bozhidar Link to this post

    pleas give me code 
    When clicking gantt  task 
    get Task Id 
  9. Peter Milchev
    Admin
    Peter Milchev avatar
    781 posts

    Posted 17 Mar Link to this post

    Hi,

    Once you get the task as suggested by Bozhidar, you can use the client-side API of the task to get its ID:

    Regards,
    Peter Milchev
    Progress Telerik

    Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
  10. bassam
    bassam avatar
    14 posts
    Member since:
    Feb 2020

    Posted 31 Mar Link to this post

    Hello,
    I am using RadGantt in my project and facing  have some points that I need you help and support:
    1. What is the attribute that distinguish between adding  child task and parent task in the RADGANTT code?
    2. I could not find an event such as onclick() , is there any way to handle this?
    3. How to change the icon of the collapse/Expand in the radGantt?
    4. Hot to change the color of the task in the RadGantt?
    5. How to disable/Enable the Radgantt ?

    I am a developer, below  is the email which was the tool registered with
Back to Top