The onColumnResize event handler fires when the user completes drag-and-drop resizing of a calendar column, before the new width is stored.
Available since 2022.3.5377.
DayPilot.Calendar.onColumnResize(args)
args.column - information about the resized column
args.newWidth (number) - new width of the resized column in pixels
args.preventDefault() - cancels the resize
When this event fires, DayPilot.Calendar.columns.list still contains the original width values. Use DayPilot.Calendar.onColumnResized(args) to read the updated width.
JavaScript
const calendar = new DayPilot.Calendar("dp", {
onColumnResize: args => {
if (args.newWidth < 80) {
args.preventDefault();
}
},
// ...
});
calendar.init();Angular
<daypilot-calendar [config]="config"></daypilot-calendar>
config: DayPilot.CalendarConfig = {
onColumnResize: args => {
if (args.newWidth < 80) {
args.preventDefault();
}
},
// ...
};React
<DayPilotCalendar
onColumnResize={onColumnResize}
{/* ... */}
/>const onColumnResize = (args) => {
if (args.newWidth < 80) {
args.preventDefault();
}
};Vue
<DayPilotCalendar @columnResize="onColumnResize" <!-- ... --> />
const onColumnResize = (args) => {
if (args.newWidth < 80) {
args.preventDefault();
}
};DayPilot.Calendar.onColumnResized