I'm developing a project in PHP, MySQL, jQuery and CSS, and I came across the following bug (in quotation marks because it's not a bug in fact) using the dataTables + bootstrap + ajax plugin:
First a table with some data is loaded, 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 get paging back on the page the user was in, to do this I need to get the 'data-dt-ix' <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 <li>
elements of this list have class 'paginate_button', I need to:
When the element has the 'paginate_button' and 'active' classes it takes the value of the data attr 'data-dt-idx', so that I pass via parameter the function that loads the table and cause it to go to the correct page and I'm not able to do that.
If someone knows how to do it, or some place where I search, I'll be grateful.