Skip to content

Commit 1920d28

Browse files
committed
Fix queue grouping: set correct ordering
1 parent aee15fd commit 1920d28

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

templates/queue.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,18 @@ <h1>
269269
};
270270

271271
if (groupByColumnName) {
272-
config.order = [[groupByColumnName + ":name", "asc"]];
272+
const colIndex = table.column(groupByColumnName + ":name").index()
273+
config.order = [[colIndex, "asc"]];
273274
config.rowGroup = {
274275
dataSrc: groupByColumnName === "status"
275276
? (row, type) => {
276277
let table = $("#table").DataTable();
277-
let statusIndex = table.column("status:name").index();
278-
let statusHtml = row[statusIndex];
278+
let statusHtml = row[colIndex];
279279

280280
// Find the corresponding DOM cell to get data-status attribute
281281
let tableRows = document.querySelectorAll("#table tbody tr");
282282
for (let tableRow of tableRows) {
283-
let statusCell = tableRow.cells[statusIndex];
283+
let statusCell = tableRow.cells[colIndex];
284284
if (statusCell && statusCell.innerHTML.trim() === statusHtml.trim()) {
285285
return getDataStatusFromCell(statusCell);
286286
}
@@ -289,11 +289,7 @@ <h1>
289289
// Fallback to HTML content
290290
return statusHtml;
291291
}
292-
: (row, type) => {
293-
let table = $("#table").DataTable();
294-
let colIndex = table.column(groupByColumnName + ":name").index();
295-
return row[colIndex];
296-
}
292+
: colIndex
297293
};
298294
}
299295
return new DataTable("#table", config);

0 commit comments

Comments
 (0)