Selected Data
- Last UpdatedOct 10, 2025
- 1 minute read
The selectedData property is used to handle the data associated to the onSelectionChange event. This property becomes null on a deselect action. For information on the event, see Gantt Chart widget events.
Example
This example retrieves the bar and segment information.
var temp = control.findByXmlNode("Widget1").widgetProperties.selectedData;
if(temp !=null && temp != "")
{
try
{
var ganttData = JSON.parse(temp);
var bar = ganttData.bar ; // retrieve the bar information
var segment = ganttData.segment; //retrieve the segment information
}
catch(ex)
{
}
}
The following is an example of bar and segment information retrieved based on the example script.
{"bar":{"ID":0,"barLabel":"BH_1245_DePalletizer"},"segment":{"ent_id":12,"log_id":1398754,"event_time_utc":"2022-10-06T23:00:00.000Z","event_end_time_utc":"2022-10-06T23:30:00.000Z","state_cd":1,"state_desc":"PLANNED DT","state_color":"#F5A623","reas_desc":"Planned Maintenance"}}
Note: In segment information, the ID is generated automatically starting at 0. The rest of the data is retrieved from the data source.