How to get selected row values from Gantt Chart?

Hi,

How to get specific column value in selected row from Gantt Chart grid?



1 Reply

PS Premkumar Sudalaimuthu Syncfusion Team March 17, 2022 10:25 AM UTC

Hi sanghoon , 
 
We can able to achieve your requirement using cellselected event. In the below sample, we are getting the values of particular cell from currentViewData using cellSelected event. Please refer to the below sample for more information. 
 
Code snippets: 
 
APP.Vue 
cellSelected: function(args){ 
      var ganttObj = document.getElementById('gantt').ej2_instances[0]; 
      selectedcellindex = ganttObj.selectionModule.getSelectedRowCellIndexes(); 
    for (var i = 0; i < selectedcellindex.length; i++) { 
      var column = (ganttObj.ganttColumns[selectedcellindex[i].cellIndexes[0]].field); 
      var value = ganttObj.currentViewData[selectedcellindex[0].rowIndex][column]; 
      console.log(value); 
    } 
  } 
      }, 
 
 
 
 
Regards, 
Premkumar S 


Loader.
Up arrow icon