preline icon indicating copy to clipboard operation
preline copied to clipboard

Initialize preline JS components in a page displayed with ajax

Open lethunder opened this issue 1 year ago • 3 comments

Discussed in https://github.com/htmlstreamofficial/preline/discussions/208

Originally posted by lethunder December 9, 2023 Hello guys, all preline js components like tabs inside a page i hide and show with ajax and append to DOM are no more working. How do i initialize preline in jquery on ajax:success

Exemple code $(document).on('ajax:success', ".display-in-offcanvas-js", function (event) {

var detail = event.detail;

var data = detail[0].body.innerHTML, status = detail[1], xhr = detail[2];

$(".application-offcanvas-js .content").html(data);

});

data contains html with preline js components

lethunder avatar Dec 28 '23 21:12 lethunder

Hi, did you solve this issue?

nocodelab avatar Jan 08 '24 11:01 nocodelab

hey, nope

lethunder avatar Jan 08 '24 12:01 lethunder

Hello guys, any answer?

lethunder avatar Feb 08 '24 10:02 lethunder

Hey @lethunder - we've added an example here https://preline.co/docs/preline-javascript.html

jahaganiev avatar Apr 03 '24 23:04 jahaganiev