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

Custom Edit in Kendo Gantt timeline row

3 Answers 342 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Vaishali
Top achievements
Rank 1
Vaishali asked on 05 Aug 2019, 11:37 PM

Here is the Dojo example of what I am trying to achieve: https://dojo.telerik.com/ewAmuVok.

The fields on the grid part of gantt should remain editable, In this case title is editable and I can edit it inline. Now, the challenging part is when I double click on the timeline task template, it opens the default editable modal. If I make use of edit for gantt, it disables the inline editing of the grid part of gantt and I can override the default behavior.

I am trying to achieve both - inline editing and open custom modal popup when double clicked. 

Any inputs will be appreciated. Thanks in advance.

edit: function(e){
    e.preventDefault();
    alert("edit");
  }

3 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 07 Aug 2019, 12:25 PM
Hello Vaishali,

As far as I can understand, you want to perform different actions in the edit event handler, depending on whether a cell is being edited or the pop-up is about to be opened. If that is the case, you could check the container element, which is part of the event arguments. In case its role is a window, a pop-up is about to be opened. If it is not, the in-cell editing is on its way:
edit: function(e){
  var container = e.container;
   
  if (container.attr('data-role') === 'window') {
    console.log('Pop-up is about to be opened.');
  } else {
    console.log('Cell is about to be edited');
  }
},

Here you will find a modified version of the sample sent implementing the above suggestion.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vaishali
Top achievements
Rank 1
answered on 10 Aug 2019, 08:53 PM

Hi,

This is correct. However, I also want to prevent the popup from opening. Is there any way to achieve it?

Thanks!

0
Ivan Danchev
Telerik team
answered on 13 Aug 2019, 03:57 PM
Hi Vaishali,

You can prevent the popup from opening by calling the preventDefault method:
edit: function(e){
  var container = e.container;
 
  if (container.attr('data-role') === 'window') {
    console.log('Pop-up is about to be opened.');
    e.preventDefault();
 
  } else {
    console.log('Cell is about to be edited');
  }
}

Modified dojo example.

Regards,
Ivan Danchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Gantt
Asked by
Vaishali
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Vaishali
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or