Button with x-on:click (Alpine JS) fire three times in a row.

Button with x-on:click (Alpine JS) fire three times in a row.

jarvisyottajarvisyotta Posts: 1Questions: 1Answers: 0

Link to test case:
https://codepen.io/ed_tanto/pen/abNpbQv?editors=1111

Description of problem:
I try to implement datatables inside Alpine JS component, I create a button for each row and add event listener using "x-on:click". The problem happen when I try to click the button, it fire the method three times. I try to dive into what happen and the clue I got is related with Datatables Orthogonal Data (my assumption because datatables render multiple source of data and create multiple buttons too), I also manually set the data-search, data-filter, data-sort but doesn't seem to make any effect.

Is there any way to disabled datatables orthogonal data or is there any way to prevent datatables to render certain attributes in tag?

Thank you all

Answers

This discussion has been closed.