JQuery on Click function does not work when table is expanded from responsive
JQuery on Click function does not work when table is expanded from responsive
ads32w
Posts: 5Questions: 2Answers: 0
When the table is on full screen function below works fine, but if I expand column with grupa_usera_button on small size and click on button alert does not appear.
$('.grupa_usera_button').on('click', function() {
alert('Test test');
});
Any ideas?
This question has an accepted answers - jump to answer
Answers
This example from this thread should help, it's demonstrating just that,
Colin
I am confused which option to use. I tried both but I have no effect.
I read everything twice and I thing these are not solutions for my problem. In my situation JQuery event does not work. Notice that reendered button after expanding row has class '.grupa_usera_button' but after click alert doesn't appear.
I think what you need os to create delegated events, like this example. Take a closer look at the selectors used for the click events in the example Colin linked to. If you still have issues please provide a test case showing what you are doing so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Yes. I needed delegated events.
Code above should be changed to:
Thanks for your time.