Question:
I’ve created a dynamic page in wix studio, and on the dynamic page there is a wix booking calendar widget. I would like to set the Staff Filter of the wix booking calendar widget to the specific staff member on the actual dynamic page.
How to access the Staff Filter of the Wix Booking Calendar by Code, and once I get the staff id of the dynamic page item, how to set it on the Staff Filter.
Product:
Wix Studio
Wix Booking Calendar Widget
Staff Filter
What are you trying to achieve:
How to access the Staff Filter of the Wix Booking Calendar by Code, and once I get the staff id of the dynamic page item, how to set it on the Staff Filter.
What have you already tried:
I get the staff name and staff id by the following way:
$w.onReady(function () {
const dynamicDataset = $w(‘#dynamicDataset’);
dynamicDataset.onReady(() => {
const itemData = dynamicDataset.getCurrentItem();
console.log("Item data from dataset:", itemData);
const staffName = itemData.title;
const staffId = itemData._id;
if (staffName && staffId) {
console.log(`Setting up booking for: ${staffName}`);
console.log(`id: ${staffId}`);
} else {
console.error("Staff name or ID not found. Check the field key in your dataset.");
}
});
});
My alendar id is: #bookingCalendar
How do I set the Staff Filter to the current staff of the dynamic page?
Additional information:
I tried to look and understand here:
And here:
The calendar is a wix widget.