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

Client event double click task

9 Answers 265 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
OfficeHeart
Top achievements
Rank 1
OfficeHeart asked on 23 Sep 2014, 08:00 AM
Hello,

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

Thanks,
Martin

9 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 24 Sep 2014, 06:33 AM
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.

 
0
André
Top achievements
Rank 1
answered on 29 Oct 2014, 06:52 PM
this exemple return taskid not value column id. have to return the value of the id column of the selected row?
0
Хосбаяр
Top achievements
Rank 1
answered on 16 Jan 2015, 03:36 AM
Trying get task id. Telerik version 2014 Q3

Cannot read property 'get_allTasks' of null 

0
Bozhidar
Telerik team
answered on 16 Jan 2015, 07:13 AM
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
0
Хосбаяр
Top achievements
Rank 1
answered on 16 Jan 2015, 08:23 AM
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



0
Bozhidar
Telerik team
answered on 19 Jan 2015, 07:10 AM
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
0
bassam
Top achievements
Rank 1
Veteran
answered on 12 Mar 2020, 02:08 PM
pleas give me code 
When clicking gantt  task 
get Task Id 
0
Peter Milchev
Telerik team
answered on 17 Mar 2020, 09:55 AM

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.
0
bassam
Top achievements
Rank 1
Veteran
answered on 31 Mar 2020, 05:18 PM
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
Tags
Gantt
Asked by
OfficeHeart
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
André
Top achievements
Rank 1
Хосбаяр
Top achievements
Rank 1
bassam
Top achievements
Rank 1
Veteran
Peter Milchev
Telerik team
Share this question
or