Questions Tagged how-to

Multiple background colors in event (Scheduler)

Answered: You can do this by inserting custom active areas into Scheduler events. The start and end of an active area can be specified using date/time values instead of pixels. That will let you insert custom ...

Custom Event Styling in React Scheduler

Answered: You can use the onBeforeEventRender event handler to customize the events . A sample implementation could look like this: onBeforeEventRender: (args) => { if(args.data.status === "completed") { args....

Scheduler Time Range Configuration

Answered: There are two ways to solve it: 1. You can define business hours using the businessBeginsHour and businessEndsHour properties and set showNonBusiness to false (see also hiding non-business hours ): c...

Conditional display of Active Areas

Answered: Yes, this is possible. You can add active areas using onBeforeEventRender where you can check if a specific property exists in the source data object (args.data): onBeforeEventRender: args => { if (a...

How to change Group task background color?

Answered: The shape of the task group is created using :before and :after pseudo-elements. In the default theme it looks like this: .gantt_default_task_group .gantt_default_event_inner { position: absolute; to...

Db connection location

Answered: The database connection is handled by your application (DayPilot doesn't connect to the DB directly). Typically, the connection string is stored in web.config (in ASP.NET applications). Note that the...

Link Connector Arrows

Answered: I see. 1. You can simply add/remove the links from the Scheduler as needed, like this: const linksToBeDisplayed = [ /* ... */ ]; dp.update({links: linksToBeDisplayed}); 2. Or you can mark the links w...

Parent Row

Answered: Steve, Sorry for the confusion! You can detect parent rows using `args.cell.isParent`: dp.onBeforeCellRender = function (args) { if (args.cell.isParent) { args.cell.backColor = "#ccc"; } }; It looks ...

Event Item

Answered: By default, the calendar displays the value of the "text" property in the event boxes. If you want to display more data, you can customize the event content using onBeforeEventRender event handler: h...

How disable focus in form.

Answered: You can use "autofocus: false" to disable autofocus or use "focus: 'anotherField'" to autofocus a selected field. const form = [ {name: "Start", id: "start", type: "datetime"}, {name: "End", id: "end...

Dropdown field in modal form

Answered: You can load the data using fetch() or a similar function before opening the modal dialog. async function showModal(url) { const options = await fetch("/api/getOptions").then(response => response.jso...

Multimove and manually snapping to grid

Answered: It is possible to change "start" end "end" properties of the additional selected events in onEventMoving. You can modify the args.multimove[x].start and args.multimove[x].end properties as needed. Ju...

Undo Redo

Answered: OK, I have the script running and incorporated within my scheduler. Much trial and error! I now have another issue. My Scheduler draws its information from an access database. The scheduler then writ...

Open link in new window

Answered: The `window.open()` function is the correct approach: {text: "Job Card", onClick: args => window.open(args.source.data.Filelocation, '_blank')}, But if the browser is set to block popup windows it wi...

Mobile Rendering

Answered: Hi Dan Thanks for the tip. I actually worked it out last night and then felt pretty thick for missing it. I'm developing on a company intranet and the tablet I was testing on was was not added to the...

Links in right Click Menu

Answered: 1. First, you need to load the link from the database and store it as an additional property of the event data object. This can be done in the backend API endpoint that returns events. In most PHP ex...

Column Filtering

Answered: In the latest sandbox build (2023.2.5562 - see https://release.daypilot.org/changes/js/ ), the args.column property now holds a DayPilot.Column object ( https://api.daypilot.org/daypilot-column-class...