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
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
0
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:
Regards,
Bozhidar
Telerik
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
Cannot read property 'get_allTasks' of null
0
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:
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:
Regards,
Bozhidar
Telerik
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
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
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
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
When clicking gantt task
get Task Id
0
Hi,
Once you get the task as suggested by Bozhidar, you can use the client-side API of the task to get its ID:
- https://docs.telerik.com/devtools/aspnet-ajax/controls/gantt/client-side-programming/objects/gantttask-object;
- task.get_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
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