Restore fixed order for grouped column (fixes #1534)

This commit is contained in:
Bernd Bestel 2021-08-04 17:41:20 +02:00
parent 10c1ccd6e4
commit 1891bc6f32
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 17 additions and 0 deletions

View File

@ -4,3 +4,4 @@
- More information on this: Only 1 level is currently supported; creating > 1 level nestings was _never_ possible via the UI/frontend, but not checked/enforced by the backend before `v3.0.0` - so it was potentially possible via the API (or any third party app/tool which utilizes it) to create such a nesting which then made this upgrade to fail
- Fixed that the "Stock by-barcode" API routes were broken (thanks @larsverp)
- Fixed that it was not possible to select a chore/battery on the corresponding tracking pages by mouse/touch
- Fixed that grouping by columns in tables may caused duplicate groups

View File

@ -801,6 +801,13 @@ $.extend(true, $.fn.dataTable.defaults, {
if ("dataSrc" in rowGroup)
{
api.rowGroup().dataSrc(rowGroup.dataSrc);
// Apply fixed order for group column
var fixedOrder = {
pre: [rowGroup.dataSrc, 'asc']
};
api.order.fixed(fixedOrder);
}
}
}
@ -1096,6 +1103,9 @@ $(document).on("click", ".change-table-columns-rowgroup-toggle", function()
};
dataTable.rowGroup().enable(false);
// Remove fixed order
dataTable.order.fixed({});
}
else
{
@ -1106,6 +1116,12 @@ $(document).on("click", ".change-table-columns-rowgroup-toggle", function()
dataTable.rowGroup().enable(true);
dataTable.rowGroup().dataSrc(columnIndex);
// Apply fixed order for group column
var fixedOrder = {
pre: [columnIndex, 'asc']
};
dataTable.order.fixed(fixedOrder);
}
var settingKey = 'datatables_rowGroup_' + dataTable.settings()[0].sTableId;