Skip to content

Conversation

@AnteSuvala
Copy link
Collaborator

No description provided.

@AnteSuvala AnteSuvala requested a review from flauc December 17, 2024 08:33
Comment on lines 496 to 501
function handleReset() {
headers = defaultHeaders;
headers.forEach((header) => {
header.disabled = false;
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually isn't correct. The default state of a table might be to have some columns disabled initially.

if (service.getColumnOrder) {
const pulledHeaders = await service.getColumnOrder(id);
if (pulledHeaders) {
headers = headers
.map((header) => {
header.disabled = !pulledHeaders.find((it) => it.key === header.key);
return header;
})
.sort((a, b) => {
const aIndex = pulledHeaders.findIndex((it) => it.key === a.key);
const bIndex = pulledHeaders.findIndex((it) => it.key === b.key);
return aIndex - bIndex;
});
}
}

This is where we pull column order from the database and override the default. You need to save a reference of the default and in set it as the current headers in handleReset()

@AnteSuvala AnteSuvala requested a review from flauc January 16, 2025 12:29
@flauc
Copy link
Member

flauc commented Jan 26, 2025

@AnteSuvala could you please resolve conflicts on this branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants