0
I am developing a project in PHP, Mysql, jQuery and CSS, and I came across the following 'bug' (in quotes because it is not a bug in fact) using the plugin dataTables+bootstrap+ajax:
First a table is loaded with some data, and when a double click is given on some line a modal bootstrap is opened with a form, and when this modal is closed, the table is updated with what was filled in the form.
PROBLEM:
When the table is updated, it returns to pagination 1, I’m trying to make the pagination go back to the page where the user was, to do this I need to take the value of the attribute 'data-dt-ix' element '<li>
' from the list of paging buttons:
<li class="paginate_button active">
<a href="#" aria-controls="DataTables_Table_1" data-dt-idx="1" tabindex="0">1</a></li>
All element <li>
of that list have the class 'paginate_button', I need that:
When the element has the classes 'paginate_button' and 'active' it takes the value of the data attr 'data-dt-idx', so that I pass via parameter the function that loads the table and make it go to the correct page and I am not able to do this.
If anyone knows how to do it, or anywhere I research, I’d be grateful.