The onRowSelected event handler fires when the user selects or deselects a row in the Gantt Chart, after the default action specified by rowSelectHandling.
Row selecting must be enabled by mapping a selected user action to "Select", for example using rowClickHandling or rowDoubleClickHandling.
DayPilot.Gantt.onRowSelected(args)args.task - DayPilot.Task object representing the task.
args.selected (boolean) - true if the new state is selected, false if the row has been deselected.
args.ctrl (boolean) - true if the Ctrl key was pressed.
args.shift (boolean) - true if the Shift key was pressed.
JavaScript
const gantt = new DayPilot.Gantt("dp", {
rowClickHandling: "Select",
rowSelectHandling: "Update",
onRowSelected: (args) => {
DayPilot.Modal.alert("Selection changed: " + args.task.text());
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
rowClickHandling: "Select",
rowSelectHandling: "Update",
onRowSelected: args => {
DayPilot.Modal.alert("Selection changed: " + args.task.text());
},
// ...
};React
<DayPilotGantt
rowClickHandling="Select"
rowSelectHandling="Update"
onRowSelected={onRowSelected}
{/* ... */}
/>const onRowSelected = (args) => {
DayPilot.Modal.alert("Selection changed: " + args.task.text());
};Vue
<DayPilotGantt
rowClickHandling="Select"
rowSelectHandling="Update"
@rowSelected="onRowSelected"
<!-- ... -->
/>const onRowSelected = (args) => {
DayPilot.Modal.alert("Selection changed: " + args.task.text());
};