Skip to main content

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

NameDescription
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

NameDescription
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

NameDescription
api.getReactiveState()Gets an object with the reactive properties of Booking
api.getState()Gets an object with the StateStore properties of Booking

Booking events

NameDescription
confirm-slotFires when confirming the booking of a slot
filter-dataFires when filters are applied
select-itemFires when an item is selected
select-item-dateFires when an item is selected
select-slotFires when selecting a slot

Booking properties

NameDescription
dataOptional. An array of objects containing the cards data
endOptional. Defines the date until which to show available slots
cardShapeOptional. An object with settings for managing information displayed on the left side of cards
filterShapeOptional. An object of settings for managing the filter functionality
formShapeOptional. An array of objects containing settings for configuring fields in the Booking dialog
infoShapeOptional. An object with settings for managing information displayed on the left side of the Booking dialog
localeOptional. An object of a custom locale of Booking
slotGapOptional. Defines a gap between booking slots for all cards
slotSizeOptional. Defines the duration of a booking slot for all cards
startOptional. Defines the date from which to start showing available slots