Problem with class=".views" jquery using Modals and dt-responsive.
Problem with class=".views" jquery using Modals and dt-responsive.
I'll try to describe the problem in details.
Environment:
HTML5, CSS3, PHP, External Javascript files, Codeigniter 3.1.11
BUG:
the element page: button does not
recognize the function written inside my javascript file for this page.
This button is inside a -tr- element of a dt-responsive table.
I can get this function using a class. $(.my-view) when the datatable is shown in every display but mobile phones.
Everything runs ok until I use the mobile phone.
The class="my-view" is ok in every display, but It's broken in every mobile phone.
I had to write the id, primary key of the record, and the record controller using the attribute onclick that belongs to the button. However, I dont like to use this kind of process.
I thank you in advance for your attention to the present request.
Answers
Not sure I totally understand the problem but maybe you need to use delegated events as described in this FAQ will help.
Kevin
Delegated events are not working right in this problem.
please see this file and test it.
https://drive.google.com/file/d/1sPUSkfdoRPuxvl3prbO7TBrLZPzyi5pA/view?usp=sharing
Ok I built a test case for you:
http://live.datatables.net/muxahora/1/edit
You need to use a different selector for the button when its in a Responsive row. You can inspect the table to see the path to the button.
Kevin