20 Answers, 1 is accepted
You can hook a click event of the Tasks in the Timeline view and get the data-uid attribute of the clicked task. Then, you can loop through the tasks collection of the RadGantt using the Client API of the control and find the task with the same uid. Once identified, you can the use the get_id() function on the task and acquire the ID of the task. Please consider the following implementation, which uses the double-click event to get the ID of the task :
Can we get it on server side?
Function call before RadGantt1.
In addition, I would like to ask you to continue the communication in the other thread, in order to avoid duplication.
Cannot read property 'get_allTasks' of null
You've posted the same question in the following thread:
Please continue the discussion only in that thread, to prevent unwanted clutter. I would also ask you to only post your questions in one thread (or open a new one). We monitor all active threads, and multiple posts may only cause confusion and clutter.
This works fine IF the user clicks on one of the timelines... but what if I really want to detect that he selected the row from the task details view?
Another question relating to treelist view...
How do I set the width of the treelist pane at design time? I seem to be having trouble locating the property for this.
I'm trying to get the ID of the selected task from the detail but the always return null.
I tried to get the property as you indicate. Using the previous example . But I can not access the property data-iud that found in the TR .
What is the problem in my code ?
Thanks for your help. With your example got the expected result.
Has anyone gotten this to work recently. When I use the above code the click event is never raised.
When i adjust code as follows:
I can extract the GanttTask ID. However even with this, the event is still only raised when clicking the Task List on the left, but not the graph on the right.
I had to load an old version of jQuery to enable this solution as 'context' was deprecated in 1.8 and removed in 3.0. If anyone can post a working version using a later version of jQuery I would appreciate it.
On a side note, i think a 'TaskSelected' Event is pretty basic, and should be supported internally like many of your other controls.
The tasks in the treelist and timeline sections of the gantt have different rendering and different class names, so you have to modify your approach for either treelist, or timeline selection. If you want both, you have to combine the code.
The very first example in this thread, sent by Nencho should work for timeline selection. Please use it "as is" and see if it's working on your side. Please also note that in this sample the deprecated context is not used.
Telerik by Progress
Thanks for the response. When I try using the posted code, no event is raised. I am using a Master Page, jQuery version 1.12.2, and telerik version 2017.1.228. The following is the code I used:
Any help would be appreciated.