forked from FrederikBaerentsen/BrickTracker
fix(tables): checked parts can now be sorted. Fixes #137
This commit is contained in:
@@ -176,6 +176,14 @@ class BrickChanger {
|
||||
// Not going through dataset to avoid converting
|
||||
this.html_parent.setAttribute(this.parent_dataset, value);
|
||||
}
|
||||
|
||||
// Update the data-sort attribute on the parent TD for sortable tables
|
||||
if (this.html_type == "checkbox") {
|
||||
const parentTd = this.html_element.closest('td');
|
||||
if (parentTd && parentTd.hasAttribute('data-sort')) {
|
||||
parentTd.setAttribute('data-sort', Number(this.html_element.checked));
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error.message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user