mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 19:16:37 +00:00
Optimized DataTables fixedOrder handling (fixes #2235)
This commit is contained in:
@@ -857,11 +857,14 @@ $.extend(true, $.fn.dataTable.defaults, {
|
||||
api.rowGroup().dataSrc(rowGroup.dataSrc);
|
||||
|
||||
// Apply fixed order for group column
|
||||
var fixedOrder = {
|
||||
api.order.fixed({
|
||||
pre: [rowGroup.dataSrc, 'asc']
|
||||
};
|
||||
|
||||
api.order.fixed(fixedOrder);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove fixed order
|
||||
api.order.fixed({});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1202,10 +1205,9 @@ $(document).on("click", ".change-table-columns-rowgroup-toggle", function()
|
||||
dataTable.rowGroup().dataSrc(columnIndex);
|
||||
|
||||
// Apply fixed order for group column
|
||||
var fixedOrder = {
|
||||
dataTable.order.fixed({
|
||||
pre: [columnIndex, 'asc']
|
||||
};
|
||||
dataTable.order.fixed(fixedOrder);
|
||||
});
|
||||
}
|
||||
|
||||
var settingKey = 'datatables_rowGroup_' + dataTable.settings()[0].sTableId;
|
||||
|
Reference in New Issue
Block a user