Adds a dependency link to the selection, keeping the other selected links.
Declaration
DayPilot.Scheduler.links.selection.add(link): voidParameters
link(DayPilot.Link| link data object | string | number): an existing link, its data object or its ID; IDs may be strings or numbers, including0
Return Value
No return value.
Notes
Programmatic selection changes do not fire onLinkSelect or onLinkSelected. Selection is separate from event and row selection. Assign stable link IDs to retain selection when link data is refreshed.
The framework excerpts belong inside an existing Scheduler component. Call the method after the control has initialized and the link has been loaded. Angular uses the DayPilot types and ViewChild; React uses useRef.
JavaScript
dp is the initialized Scheduler instance.
dp.links.selection.add("L1");Angular
<daypilot-scheduler [config]="config" #scheduler></daypilot-scheduler>@ViewChild("scheduler") scheduler!: DayPilotSchedulerComponent;
config: DayPilot.SchedulerConfig = {linkClickHandling: "Select"};
checkSelection() {
const dp = this.scheduler.control;
dp.links.selection.add("L1");
}React
const scheduler = useRef(null);
function checkSelection() {
const dp = scheduler.current;
dp.links.selection.add("L1");
}
<DayPilotScheduler
controlRef={control => { scheduler.current = control; }}
linkClickHandling={"Select"}
/>Vue
<script setup>
import {ref} from "vue";
const scheduler = ref(null);
function checkSelection() {
const dp = scheduler.value.control;
dp.links.selection.add("L1");
}
</script>
<template>
<DayPilotScheduler ref="scheduler" linkClickHandling="Select" />
</template>See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot