Bug 33736: Ensure datatable filter row takes visible into account
We clone the header row, and then iterate it assuming the iterator index lines up with the column definition index of the datatables settings. However, if a column is hidden, this is not the case. Said column will not appear in the header row that's cloned and as such your iterator will no longer line up with the column settings index number of the settings array. Sponsored-by: PTFS Europe Ltd Signed-off-by: Esther Melander <esther@bywatersolutions.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
6392f90b5f
commit
025ed2d09a
|
|
@ -830,7 +830,13 @@ function _dt_on_visibility(add_filters, table_node, table_dt){
|
|||
function _dt_add_filters(table_node, table_dt, filters_options = {}) {
|
||||
$(table_node).find('thead tr').clone().appendTo( $(table_node).find('thead') );
|
||||
|
||||
let j = -1;
|
||||
$(table_node).find('thead tr:eq(1) th').each( function (i) {
|
||||
j++
|
||||
var is_visible = table_dt.settings()[0].aoColumns[j].bVisible;
|
||||
if ( !is_visible ) { j++ }
|
||||
i = j;
|
||||
|
||||
var is_searchable = table_dt.settings()[0].aoColumns[i].bSearchable;
|
||||
$(this).removeClass('sorting').removeClass("sorting_asc").removeClass("sorting_desc");
|
||||
$(this).data('th-id', i);
|
||||
|
|
|
|||
Loading…
Reference in New Issue