I would like init a Jquery dataTable in svelte. My first solution was :
I create in my html page a script function with Jquery dataTable
<script>
function initTable() {
if( $('#datatable').length ) {
$('#datatable').dataTable({
sDom: "<'row'<'col-sm-6'l><'col-sm-6'f>r>t<'row'<'col-sm-6'i><'col-sm-6'p>>",
"order": [[ 1, "desc" ],[0,"asc"]],
});
}
}</script>
And in my component:
onMount(initTable)
It work. However now, i would like add data in my table. So i use {#await} {:then data} {/await}
But, my table is not initiat. If I use in my consol the function initTable, my table become a datatable
Sorry for my english if you don't understand tell me, i will try to correct my post.