I make a call to the booking plugin to generate a modal with this code, but when I show it, it loses the interactivity of the events. How I can avoid this?
$.ajax({
type: "POST",
url: "booking/reservation/modal",
data: JSON.stringify(data),
contentType: "application/json",
success: function (response) {
resolve(response)
$("body").append(response.result)
$(".modal").modal("show") },
xhrFields: {
withCredentials: true,
},
})
result.response is give me this html:
\n\n"\n\n\n\n\n\n\nBOOK YOUR SLOT\n \n\n\n\n \n\n \n\n \n \n START DATE\n \n\n \n\n \n\n\n \n \n END DATE\n \n\n \n\n\n\n\n\n\n\n \n Select Plan:\n \n $ 0.00\n\n\n\n\n \n\n\n \n\n\n \n\n\n\n\n\n\n\n\n \n\n\n Total:\n \n $ 0.00\n\n\n \n\n\n Book Now\n\n
class="modal-header py-2"
data-oe-model="ir.ui.view "
data-oe-id="1593 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/div[1]/div[1]/div[1] "
>
BOOK YOUR SLOT
class="pull-right select_bk_date"
style="font-size: 16px; color: #1cbc8c"
>
class="input-group date"
id="bk_datepicker "
data-target-input="nearest "
data-oe-model="ir.ui.view "
data-oe-id="1593 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/div[1]/div[1]/div[2]/div[1]/span[1]/div[1] "
data-bk_end_date="2022-12-01 "
data-bk_default_date="2021-11-21 "
>
type="text "
name="bk_date "
id="bk_sel_date "
data-target="#bk_datepicker "
style="display: none"
/>
class="input-group-append"
data-target="#bk_datepicker "
data-toggle="datetimepicker "
>
START DATE
class="col-4"
data-oe-model="ir.ui.view "
data-oe-id="1593 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/div[1]/div[1]/div[2]/div[2] "
>
class="pull-right select_bk_date"
style="font-size: 16px; color: #1cbc8c"
>
class="input-group date"
id="bk_datepicker_out "
data-target-input="nearest "
data-oe-model="ir.ui.view "
data-oe-id="1593 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/div[1]/div[1]/div[2]/div[3]/span[1]/div[1] "
data-bk_end_date="2022-12-01 "
data-bk_default_date="2021-11-21 "
>
type="text "
name="bk_date_out "
id="bk_sel_date "
data-target="#bk_datepicker_out "
style="display: none"
/>
class="input-group-append"
data-target="#bk_datepicker_out "
data-toggle="datetimepicker "
>
END DATE
class="pull-left"
style="font-size: 16px; margin-top: 22px; font-weight: bold"
data-oe-model="ir.ui.view "
data-oe-id="1587 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/span[1] "
>
Select Plan:
data-oe-type="monetary "
data-oe-expression="00.00 "
class="pull-right bk_plan_base_price"
style="white-space: nowrap"
>$ 0.00 >
class="col-md-7 col-12"
style="text-align: left; padding-left: 0"
data-oe-model="ir.ui.view "
data-oe-id="1593 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/div[1]/div[1]/div[3]/div[2]/div[1]/div[1] "
>
class="bk_qty_sel"
name="add_qty "
type="hidden "
value="1 "
/>
data-oe-id="1593 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/div[1]/div[1]/div[3]/div[2]/div[1]/div[2]/span[1] "
>Total:
data-oe-type="monetary "
data-oe-expression="00.00 "
class="bk_total_price"
style="white-space: nowrap"
>$ 0.00 >
class="row"
style="padding: 0 15px; margin-bottom: 7px"
data-oe-model="ir.ui.view "
data-oe-id="1593 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/div[1]/div[1]/div[3]/div[2]/div[2] "
>
class="row"
style="padding: 0 15px"
data-oe-model="ir.ui.view "
data-oe-id="1593 "
data-oe-field="arch "
data-oe-xpath="/t[1]/div[1]/div[1]/div[1]/div[3]/div[2]/div[3] "
>
>Book Now >
\n\n"\n\n\n\n\n\n\nBOOK YOUR SLOT\n \n\n\n\n \n\n \n\n \n \n START DATE\n \n\n \n\n \n\n\n \n \n END DATE\n \n\n \n\n\n\n\n\n\n\n \n Select Plan:\n \n $ 0.00\n\n\n\n\n \n\n\n \n\n\n \n\n\n\n\n\n\n\n\n \n\n\n Total:\n \n $ 0.00\n\n\n \n\n\n Book Now\n\n\n\n"\n\n\n\n\n\n\nBOOK YOUR SLOT\n \n\n\n\n \n\n \n\n \n \n START DATE\n \n\n \n\n \n\n\n \n \n END DATE\n \n\n \n\n\n\n\n\n\n\n \n Select Plan:\n \n $ 0.00\n\n\n\n\n \n\n\n \n\n\n \n\n\n\n\n\n\n\n\n \n\n\n Total:\n \n $ 0.00\n\n\n \n\n\n Book Now\n\n\n\n"\n\n\n\n\n\n\nBOOK YOUR SLOT\n \n\n\n\n \n\n \n\n \n \n START DATE\n \n\n \n\n \n\n\n \n \n END DATE\n \n\n \n\n\n\n\n\n\n\n \n Select Plan:\n \n $ 0.00\n\n\n\n\n \n\n\n \n\n\n \n\n\n\n\n\n\n\n\n \n\n\n Total:\n \n $ 0.00\n\n\n \n\n\n Book Now\n\n