Questions Tagged how-to
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 => {
...
How to change Group task background color?
Hello, I am using css modules in my project, so not able to use simple CSS. I was trying to change the color of group from blue to grey. By cssClass property, the whole box background changes to grey...
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...
Writing current date and time to DB from a context menu item
Answered: Something like this could work (you will need to adjust it for your needs):
async function clockOn() {
const modal = await DayPilot.Modal.confirm("Are you sure you want to clock onto this job?...
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 li...
Adjusting event height leads to excessive empty space (Month)
Answered: So simple solution: It's not:
eventHeight: "50",
it's:
eventHeight: 50,
How can I change the name of the event groups?
Answered: You can set custom HTML displayed by the group using onBeforeGroupRender event: https://api.daypilot.org/daypilot-scheduler-onbeforegrouprender/
onBeforeGroupRender: args => {
args.group.html = ...
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"...
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", ...
Save selected dropdown item to the database
Answered: After the modal dialog is closed, you need to call an API endpoint that will save the changes. You can access the updated data object as "modal.result". The selected value is accessible as "modal.res...
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 => respons...
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 i...
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...
Working Hour
Answered: You can customize the business hours using businessBeginsHour and businessEndsHour propertes. See also: https://doc.daypilot.org/scheduler/business-hours/
Quotation
Answered: It is only available as a package. You can find the pricing details at the Buy page (https://javascript.daypilot.org/buy/). If you have any questions regarding licensing or if you need a PDF quote, p...
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/)...
How to remove the DEMO tag when you use GUI to generate a vue gantt project?
Answered: In Vue projects, you need to replace the NPM link in package.json with the one that you get in the customer area (a licensed version).
How to increase the Event height in a schedular
Answered: https://api.daypilot.org/daypilot-scheduler-eventtextwrappingenabled/
Update Scheduler Resources/Events
Answered: Please disregard, this has been solved. The scheduler was not initialize in the correct spot to make it globally available aboutside the rendered callback.
How to add cssClass to Context Menu in Gantt Chart View.
Answered: The cssClass property will be added in the next release. At this moment, you can apply custom class using the "theme" property. The theme name is used as a prefix for all classes used for menu elemen...
Gantt View: scrollable context menu or a button to expand
Answered: At this moment, the vertical scrollbar is not implemented. Just adding the CSS isn't enough as the calculated height needs to be taken into account. I recommend splitting the long list into several g...
Insert another textarea
Answered: You can use a custom modal dialog and add as many field as needed. Here is an example:
async function modalText() {
const form = [
{name: "Name", id: "name", type: "text"},
{name: "D...
DayPilot.Modal.close Not Working
Answered: In order to access objects from the "DayPilot" namespace, you need to include "daypilot-all.min.js". In this case, this means you need to include it in both pages (in the main page and in the modal c...
Unable to dp.init() in Lightning Web Component
Answered: LWC uses virtual DOM so you will need to adjust the code a bit. 1. Make sure that the init code is in renderedCallback(). This ensures that the placeholder will be available. 2. The DayPilot.Schedule...
How to set two input field in one row
Answered: The modal dialog form is designed to display one field per row. You might be able to adjust the CSS to display two fields per row but it is not supported out of the box at the moment.
Gantt View: Is it possible to have more that one progress bars for the Gantt task
Answered: Yes, you can add a custom progress bar using active areas. This approach is outlined in this tutorial (it's for React and Scheduler but the same logic can be used in the Gantt chart component): https...
Questions 1-30 of 2780
Next