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.
Declaration
DayPilot.Gantt.onRowSelected(args)Parameters
args.task- DayPilot.Task object representing the task.args.selected(boolean) -trueif the new state is selected,falseif the row has been deselected.args.ctrl(boolean) -trueif the Ctrl key was pressed.args.shift(boolean) -trueif the Shift key was pressed.
Examples
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());
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot