API overview
Booking constructor
new booking.Booking("#root", {
// initial configuration parameters
});
Parameters:
- an HTML container (the ID of the HTML container)
- an object of the configuration parameters (check here)
Booking methods
Name | Description |
---|---|
serialize() | Serializes Booking data into a JSON array |
setConfig() | Updates the current configuration of the Booking widget |
setConfirmHandler() | Allows setting the handler for confirming slots |
setLocale() | Applies a new locale to Booking |
Booking internal API
Event Bus methods
Name | Description |
---|---|
api.detach() | Allows removing/detaching event handlers |
api.exec() | Allows triggering the inner events |
api.intercept() | Allows intercepting and preventing the inner events |
api.on() | Allows attaching a handler to the inner events |
api.setNext() | Allows adding some action into the Event Bus order |
State methods
Name | Description |
---|---|
api.getReactiveState() | Gets an object with the reactive properties of Booking |
api.getState() | Gets an object with the StateStore properties of Booking |
Booking events
Name | Description |
---|---|
confirm-slot | Fires when confirming the booking of a slot |
filter-data | Fires when filters are applied |
select-item | Fires when an item is selected |
select-item-date | Fires when an item is selected |
select-slot | Fires when selecting a slot |
Booking properties
Name | Description |
---|---|
data | Optional. An array of objects containing the cards data |
end | Optional. Defines the date until which to show available slots |
cardShape | Optional. An object with settings for managing information displayed on the left side of cards |
filterShape | Optional. An object of settings for managing the filter functionality |
formShape | Optional. An array of objects containing settings for configuring fields in the Booking dialog |
infoShape | Optional. An object with settings for managing information displayed on the left side of the Booking dialog |
locale | Optional. An object of a custom locale of Booking |
slotGap | Optional. Defines a gap between booking slots for all cards |
slotSize | Optional. Defines the duration of a booking slot for all cards |
start | Optional. Defines the date from which to start showing available slots |