diff --git a/docs/api/internal/booking-detach.md b/docs/api/internal/booking-detach.md new file mode 100644 index 0000000..6e39897 --- /dev/null +++ b/docs/api/internal/booking-detach.md @@ -0,0 +1,56 @@ +--- +sidebar_label: api.detach() +title: detach Method +description: You can learn about the detach method in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking. +--- + +# api.detach() + +## Description + +Allows removing/detaching event handlers + +## Usage + +~~~jsx {} +api.detach(tag: number | string ): void; +~~~ + +## Parameters + +- `tag` - the name of the action tag + +## Example + +In the example below we add an object with the **tag** property to the [`api.on()`](/api/internal/booking-on) handler, and then we use the `api.detach()` method to stop logging the [`open-filter`](/api/events/booking-selectslot-event) event. + +~~~jsx {5-19} +const widget = new booking.Booking("#root", { + data, + //other configuration parameters +}); + +// add handler +if (booking.api) { + booking.api.on( + "select-slot", + ({ id }) => { + console.log("Selected: " + id); + }, + { tag: "track" } + ); +} + +// detach handler +function stop() { + booking.api.detach("track"); +} + +const button = document.createElement("button"); + +button.addEventListener("click", stop); +button.textContent = "Stop logging"; + +document.body.appendChild(button); + +~~~ \ No newline at end of file diff --git a/docs/api/overview/booking-events-overview.md b/docs/api/overview/booking-events-overview.md index 9ff80f4..9b01996 100644 --- a/docs/api/overview/booking-events-overview.md +++ b/docs/api/overview/booking-events-overview.md @@ -9,7 +9,7 @@ description: You can have an API overview of JavaScript Booking in the documenta | Name | Description | | ----------------------------------------- | ------------------------------------------------ | -| [](..events/booking-confirmslot-event.md) | @getshort(../events/booking-confirmslot-event.md) | +| [](../events/booking-confirmslot-event.md) | @getshort(../events/booking-confirmslot-event.md) | | [](../events/booking-filterdata-event.md) | @getshort(../events/booking-filterdata-event.md) | | [](../events/booking-selectitem-event.md) | @getshort(../events/booking-selectitem-event.md) | | [](../events/booking-selectitemdate-event.md) | @getshort(../events/booking-selectitemdate-event.md) | diff --git a/docs/guides/configuration.md b/docs/guides/configuration.md index 0d550c9..8751869 100644 --- a/docs/guides/configuration.md +++ b/docs/guides/configuration.md @@ -476,7 +476,7 @@ new booking.Booking("#root", { ### Enabling the autoApply mode for the filter -To hide the **Search** button and make the filter apply right after a user's input, set the `autoApply` parameter of the [`filterShape`](/api/config/booking-filterShape) property to **true**. +To hide the **Search** button and make the filter immediately apply a user's input, set the `autoApply` parameter of the [`filterShape`](/api/config/booking-filterShape) property to **true**. Example: diff --git a/docs/news/whats_new.md b/docs/news/whats_new.md index 93b5ad0..c30f394 100644 --- a/docs/news/whats_new.md +++ b/docs/news/whats_new.md @@ -5,3 +5,13 @@ description: SEO data --- # What's new + +## Version 1.0.0 + +### Initial functionality + +- Configurable cards with data +- Configurable fields and data displayed in the Booking dialog +- Configurable slot duration and gap between slots +- Configurable filter +- Localization