could not able to catch the onclick event of a datatable button's
could not able to catch the onclick event of a datatable button's
thippeswamydc
Posts: 6Questions: 2Answers: 0
Hi,
I'm trying to provide a function to a update button but the jquery is not able to catch the button click event, what would be the problem?live.datatables.net/nufimobe/1/edit
see code $('#tableData tbody').on('click','button',function(){alert('function is called');});
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Hi @thippeswamydc ,
You're create the event before the buttons are created - if you move it to
initComplete
, everything works as expected - see here.Cheers,
Colin
Hi @colin , The link shared by u is not showing the alert msg, I don't think it's working properly.
No, I changed it to be
console.log()
as the alerts are blocked.You are right.
Thank you, it's happening as expected.