Enhanced Popover
This is an upcoming beta feature that will be released soon!
The enhanced popover is a new version of the event popover. It opens in the center of the calendar, can be dragged anywhere on the calendar, and stays open when you click outside it. It can also be customized far more than the standard popover.
- JSON popover: design a calendar's popover yourself, with no code. Choose its fields, put them side by side or in drawers, add buttons, and show or lock fields based on the event.
- JavaScript: change the popover for every calendar from an app action: rename, move, hide or add rows, and run your own code when rows are clicked.
- CSS: style the popover, or one calendar's popover, in Custom CSS.
Turning it on
In Administrator Settings, under Views, set Use enhanced popover to Yes.
JSON popover
A JSON popover replaces a calendar's popover with one you design. Each calendar can have its own.
- Open the calendar's settings and choose the Popover tab. The tab only appears when the enhanced popover is on.
- Turn on Use this JSON for the calendar's popover.
- Type or paste your JSON in the box, then click Save. Your changes are kept while you move around settings, until you save them or reload the page.
The calendar uses the standard popover config until the switch it turned on. You can still edit and save the JSON while it's off.
To build on the standard popover rather than start from nothing, click Start from the standard popover. It fills the box with the standard popover's fields.
Click Show examples and field names for examples made from that calendar's own fields, each with a Copy button, and a list of the calendar's custom fields.
Tip: edit the JSON in Draft Settings Mode, so you can try changes before other users see them.
Errors and warnings
Problems are listed under the box with where they are, like layout › #3 › field for the third row's field.
- Errors (red) mean the JSON can't be used, like a field name that doesn't match any field, or a drawer that doesn't exist. You're asked to confirm before saving JSON with errors, and the calendar shows the standard popover until they're fixed.
- Warnings (orange) don't stop the JSON popover from working, and the rest of the popover still shows. They point out things like a field that isn't mapped or isn't enabled in Field Mapping, meaning it won't show.
If a saved JSON popover stops working, for example because a field it uses was removed from Field Mapping, the calendar shows the standard popover with a note at the top: "Standard popover shown due to JSON config error".
Referencing fields
A field can be referenced three ways. DayBack looks for them in this order:
- Its DayBack id, like
status. See "Standard fields" at the end of this article. Custom fields also have an id. - Its database or API name, the field it's mapped to in Field Mapping or Custom Fields, like
Job_Number__c. - Its label, like
Job Number.
Names and labels don't care about upper or lower case. If a name or label matches more than one field, the first one is used and you'll see a warning.
Examples
Simple popover config: A list of fields, shown one per row in that order:
["title", "start", "end", "status", "description"]

Columns, labels and conditions
{
"layout": [
"title",
"start",
"end",
{"columns": [["status"], ["resource"]]},
{
"field": "location",
"label": "Site",
"readOnlyWhen": {"is": "existing"}
},
{
"field": "description",
"visibleWhen": {"field": "status", "empty": false}
}
]
}

Drawers, buttons, footer, size and phones
{
"width": 420,
"layout": [
"title",
"start",
"end",
{"drawer": "details", "label": "Details"},
{"columns": [
[{"button": "Open Website", "action": {"url": "https://dayback.com"}}],
[{"button": "Help Center", "action": {"url": "https://docs.dayback.com"}}]
]}
],
"drawers": {
"details": {
"title": "Details",
"layout": ["description", "location", "contact"]
}
},
"footer": ["delete", "save", "actions"],
"mobile": {
"layout": [
"title",
"start",
"end",
{"drawer": "details", "label": "Details"}
],
"footer": ["delete", "save"]
}
}

Popover properties
For more than a list of fields, use an object with a layout . Everything else is optional.
layout: the popover's rows, field names, or the rows described under Rows.drawers: named drawers that rows and buttons can open, like{"details": ["description", "location"]}. See Drawers.footer: the buttons at the bottom. Leave it out for the standard footer. See Footer.width: the popover's width in pixels, from 200 to 2000. The standard is 280. Phones ignore it.height: the popover's height in pixels, from 200 to 2000. The standard is 460. Phones ignore it.mobile: a different popover for phones. See Mobile.defaultdrawer: the drawer that opens with the popover. See Opening a drawer with the popover.
Mobile
Phones use the samelayout , drawers andfooter , with columns stacked. To modify the popover just for mobile devices, create amobile section with your desired customizations.
Anything you leave out uses the setting for the non-mobile popover. Phones show the popover full screen, so awidth orheight property inmobile is ignored, with a warning.
Here's an example of a custom mobile layout section
"mobile": {
"layout": ["title", "start", "end", {"drawer": "more"}],
"drawers": {
"more": {
"title": "More",
"layout": ["status", "resource", "description"]
}
},
"footer": ["delete", "save"]
}
Rows
Therow property can go in layout, columns, drawers, and mobile sections. Here are some examples of content that can be put in a row
"status": a field, by its id, database name or label.{"field": "status", "label": "Stage"}: a field with options:labelto show a different label.{"columns": [["status"], ["resource"]]}: side by side columns. Each column is a list of rows. See Columns.{"text": "Billing"}: a line of text, like a heading.{"divider": true}: a horizontal line.{"drawer": "details", "label": "Details"}: a row that opens one of the drawers. Withoutlabelit shows the drawer's title, or its name.{"button": "Open Website", "action": {"url": "https://dayback.com"}}: a button. See Buttons.
Columns
Columns share the popover's width equally. To size a column, write it as an object with awidth and a layout :
{"columns": [ {"width": "2fr", "layout": ["status"]}, {"width": "120px", "layout": ["resource"]} ]}
A width can be a share like"2fr" (twice the space of a"1fr" column), pixels like"120px" , or a number of pixels like120 .
Columns work best for short fields like status and resource. Start and end need the full width for the date, time and duration.
Drawers
A drawer slides out beside the popover. Name it indrawers , then open it from a drawer row or a button. A drawer is a list of rows, or an object with atitle :
"drawers": {
"details": {"title": "Details", "layout": ["description", "location"]},
"people": ["contact", "project"]
}

Drawers can open other drawers:
- A drawer row or button inside a drawer opens the other drawer on top of it, with a back arrow to return to the first one.
- A field in a drawer that has its own drawer, like Status, Resource or a picklist custom field, opens it the same way, titled with the field's name.
- While drawers are stacked, the row in the popover that opened the first one stays highlighted, so you can see where you started.
- On phones, drawers fill the screen, and Back returns to the drawer before.
- A drawer can't open itself and will show a warning in the config.
Opening a drawer with the popover
With a JSON popover, the Default Popover Drawer in the calendar settings only opens the selected drawer if it's included in the popover layout. Opening another drawer replaces it, so without one it would be gone until the popover is opened again. When the popover can't open it, the Popover tab shows a warning and no drawer opens by default.
To specify the default drawer in the JSON instead, adddefaultdrawerto your settings. It's used instead of the calendar's setting, and can be:
- the name of one of your drawers, like "details";
- a field with a drawer, like "status" or "location", or a picklist or date custom field, which opens its picker;
- "actions" for the Button Actions drawer;
- false for no drawer.
{
"layout": ["title", "start", "end", "status", {"drawer": "details", "label": "Details"}],
"drawers": {"details": {"title": "Details", "layout": ["description", "location"]}},
"defaultDrawer": "details"
}
Like the calendar's setting,defaultdraweronly opens if something in the popover can open it by being clicked. Otherwise the calendar's Default Popover Drawer opens instead (when the popover can open that one), and the Popover tab shows a warning.
Ifdefaultdrawerisn't one of these, the Popover tab shows a warning and no drawer opens.
Buttons
A button'saction is one of these:
"save": save and close."delete": delete the event (asks to confirm)."close": close the popover.{"drawer": "details"}: open one of thedrawers.{"url": "https://..."}: open a web address.{"buttonAction": "Geocode"}: run one of the calendar's Custom Button Actions, by its name.
Running a button action
A button can run any Custom Button Action you've registered on the calendar, the same as choosing it from the Button Actions menu (cog):
{"button": "Geocode", "action": {"buttonAction": "Geocode"}}
- Specify the action by its name (capitals don't matter).
- The button only shows for events the action is turned on for. For example, an action turned on only for editable events doesn't show its button on read only events.
- If several actions have the same name, the first one turned on for the event runs, and you'll see a warning.
- If no action has that name, the Popover tab shows a warning and the button doesn't show.
Footer
The footer is a list of these, in order. Leavefooter out to use the standard footer.
"delete": Delete (Cancel for new events). Hidden when the event is read only."save": Save & Close (Save & Back on phones, and Close when the event is read only)."actions": the Button Actions menu (cog).{"button": "...", "action": ...}: a button, as described under Buttons. It can have avisibleWhencondition.
"footer": [
"delete",
{"button": "Details", "action": {"drawer": "details"}},
"save"
]
Conditions
visibleWhen shows an element only when its condition is true.readOnlyWhenmakes a field read only when its condition is true.
{
"field": "description",
"visibleWhen": {"field": "status", "equals": "Cancelled"}
},
{"field": "location", "readOnlyWhen": {"is": "existing"}}
Comparing a field
Name the field, then give one comparison:
equals: the field equals this value.notEquals: the field doesn't equal this value.in: the field is one of these values:["A", "B"].notIn: the field isn't any of these values.contains: the field contains this text (upper and lower case don't matter).empty:truewhen the field is empty,falsewhen it has a value.greaterThan: the field is greater than this number or date.lessThan: the field is less than this number or date.
A few things to know:
- For fields with several values, like status and resource, a comparison is true when any of the values match.
- Write dates as
"2026-12-31". - Individual checkboxes (
allDay,repeat,todo,done) and individual custom fields can be used in conditions, like{"field": "done", "equals": true}or{"field": "Job Number", "empty": false}. - The
checkboxesandcustomFieldsrows can't be used, because each one stands for several fields. Neither caneventURL, which is a link rather than a value.
Event states
Useisto check the event rather than a field, like{"is": "new"}:
new: the event hasn't been saved yet.existing: the event has been saved.editable: the event can be edited.readOnly: the event is read only.allDay: the event is all day.repeating: the event repeats.mobile: the popover is on a phone.
Combining conditions
all: true when every condition in the list is true.any: true when at least one is true.not: true when the condition is false.
{
"layout": [
"title", "start", "end", "status",
{"field": "resource", "visibleWhen": {"any": [{"is": "new"}, {"field": "status", "empty": true}]}},
{"field": "description", "visibleWhen": {"all": [{"is": "existing"}, {"not": {"field": "status", "in": ["Done", "Cancelled"]}}]}}
]
}
Customizing with JavaScript
For changes the JSON popover can't make, or to change the popover on every calendar at once, use dbk.eventPopoverin an On Startup app action. Layouts are cleared each time the calendar loads, and your action sets them again.
JavaScript changes run on top of JSON popovers too. On a calendar with a JSON popover, your transform gets that calendar's JSON layout instead of the standard one.
Changing the layout
setLayouttakes atransformfunction. It runs each time a popover opens, with a copy of the layout for that event. Change the layout with the layout tools (below), then return it.
dbk.eventPopover.setLayout({
transform: ({ layout, editEvent, tools }) => {
// Rename Calendar to Schedule
tools.find({layout, id: 'calendar'}).row.label = 'Schedule';
// Show status above the dates
tools.move({ layout, id: "status", beforeId: "dateTime" });
// Remove the project row
tools.remove({ layout, id: "project" });
return layout;
},
});
If a transform throws an error, the popover opens with the standard layout, and admins see the error.
CallsetLayoutonce. Calling it again replaces the earlier transform, so put all of your changes in one transform.
Layout tools
Each tool finds rows byid, including rows nested inside groups. See Standard row ids.
tools.find({layout, id}): returns{row, parent, index}, ornullif there's no row with that id.tools.remove({layout, id}): removes the row and returns it.tools.insertBefore({layout, id, row}): adds a row before the row with that id.tools.insertAfter({layout, id, row}): adds a row after the row with that id.tools.replace({layout, id, row}): replaces the row with that id.tools.move({layout, id, beforeId}): moves a row before another row. UseafterIdto move it after.
Row properties
A row is an object with anidand acomponent. These are the properties you'll use most:
id: a unique name for the row.component: what the row is, like"Row","Button","Group"or"Custom".dbk.eventPopover.componentslists them all.field: the event field the row shows and edits, like"location".label: the row's label. Text, or a function({edit}) => text.props: options for the component, like{class: "text-center", style: "margin: 10px 0"}for a Group.children: rows inside aGroup.visible:({edit}) => true or false. The row only shows when this returns true.locked:({edit}) => true or false. The row is read only when this returns true.onclick:({event, edit}) => .... Runs instead of the row's normal click.beforePanelOpen:({event, panel, edit}) => .... Runs before the row opens its drawer. Returnfalseto keep the drawer closed.render: forCustomrows,{node, edit}) => ...fills the row's element with your own content. Return a function to clean up when the row is removed.
In these functions,editis the event being edited, with the changes made so far.
JavaScript examples
Add a button
tools.insertAfter({
layout,
id: "status",
row: {
id: "websiteRow",
component: "Group",
props: { class: "text-center", style: "margin: 10px 0" },
children: [
{
id: "websiteButton",
component: "Button",
label: "Open Website",
props: { size: "sm" },
onclick: () => window.open("https://dayback.com", "_blank"),
},
],
},
});
Only show the location for saved events
tools.find({ layout, id: "location" }).row.visible = ({ edit }) =>
!!edit.eventID;
Open your own picker instead of the status drawer
onclickreplaces the click completely.beforePanelOpenlets you decide, each time, whether the drawer opens:
tools.find({ layout, id: "status" }).row.beforePanelOpen = ({
edit,
event,
}) => {
if (edit.schedule.name !== "Projects") {
return;
// Open the status drawer as usual
}
openMyStatusPicker({ edit, event });
return false;
// Keep the status drawer closed
};
beforePanelOpencan also return a promise. The drawer stays closed if the promise resolves to false.
Your own content.
tools.insertAfter({
layout,
id: "title",
row: {
id: "note",
component: "Custom",
render: ({ node, edit }) => {
node.textContent = edit.eventID ? "" : "New events need a status";
},
},
});
Other methods
dbk.eventPopover.setLayout({layout}): use this layout (a list of rows) for every popover instead of the standard one. It can be combined withtransform.dbk.eventPopover.getDefaultLayout(): a copy of the standard layout, to look at its rows or build your own from it.dbk.eventPopover.setDrawerLayout({drawer, transform}): change a drawer's layout, likesetLayout. The Custom Fields drawer is"customFields", and its rows' ids arecustomField-plus the custom field's id.dbk.eventPopover.getDefaultDrawerLayout({drawer, editEvent}): a copy of a drawer's standard layout for an event.dbk.eventPopover.registerHandler({name, handler}): give a function a name, so rows can use the name instead of the function, likeonclick: "openMyPicker".dbk.eventPopover.unregisterHandler({name}): remove a function registered withregisterHandler.dbk.eventPopover.resetLayout(): go back to the standard layouts.dbk.eventPopover.mount({component, target, props}): put one of the popover's components anywhere, like inside aCustomrow. Returns{update, destroy}.
// Hide one custom field in the Custom Fields drawer
dbk.eventPopover.setDrawerLayout({
drawer: 'customFields',
transform: ({layout, tools}) => {
tools.remove({layout, id: 'customField-' + 'yourCustomFieldId'});
return layout;
},
});
Styling with CSS
Generally, the enhanced popover can be modified with CSS the same way the standard popover can.
The enhanced popover hasdata-popover="enhanced", so CSS can style it without affecting the standard popover:
.dbk_editEvent[data-popover="enhanced"] { font-size: 15px; }
Rows in the enhanced popover each have adata-nameattribute that can be used to target them with CSS.
Standard fields
The ids to use for DayBack's standard fields in a JSON popover. Each calendar's custom fields, with their labels and database names, are listed under Show examples and field names on its Popover tab.
title: event title.description: event description (rich text when the calendar allows HTML).eventURL: link to the event in its source calendar.checkboxes: All Day, Repeat, To-Do, Done, attachments and images on one line, as in the standard popover.allDay: All Day checkbox.repeat: Repeat checkbox (calendars that support repeating events).todo: To-Do checkbox (calendars that support to-dos).done: Done checkbox for to-dos.start: start date and time.end: end date and time.calendar: the calendar the event is on.list: to-do list (calendars that support to-dos).location: location with map.resource: resources.status: status.contact: related contact.project: related project.customFields: the row that opens the Custom Fields drawer.
Standard row ids
The ids of the standard layout's rows, for JavaScript. Indented rows are inside the row above them.
title: Title.description: Description (plain text).htmlDescription: Description (rich text, when the calendar allows HTML).eventURL: View In Source link.dateTime: group with the checkboxes, start and end.allDayRepeating: the checkboxes line.attachments,images,allDay,repeat,todo,done: each item on the checkboxes line.
start: Start.end: End.calendar: Calendar.list: To-do list.location: Location.resource: Resource.relatedResource: Related resource (when the calendar has one).status: Status.contact: Contact.project: Project.customFields: Custom Fields row.