The event data need to be passed as "data" parameter.
Let's say you have the following event:
{
start: "2022-06-01T00:00:00",
end: "2022-06-05T00:00:00",
text: "Long description",
resource: 1,
id: 1
}
In onEventClick (and other events), you get DayPilot.Event object which stores the original object under "data" property (see also https://api.daypilot.org/daypilot-event-data/).
You can open the modal dialog like this:
onEventClick: async args => {
const data = args.e.data;
const form = [
{
type: 'textarea',
id: 'text',
name: 'Event description',
},
];
const modal = await DayPilot.Modal.form(form, data);
console.log("updated data object", modal.result);
}
The form[].id property specifies the source of the item data (in this case it will read the description from data.text).