Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customHeader Bug #2072

Open
kyhgogle006 opened this issue Oct 14, 2024 · 2 comments
Open

customHeader Bug #2072

kyhgogle006 opened this issue Oct 14, 2024 · 2 comments
Labels

Comments

@kyhgogle006
Copy link

image

I am using customHeader to customize the headers, but it does not apply when the screen is first opened.
It only applies after the data is retrieved, and the class is set correctly.
Is there a way to make sure it applies and persists when the screen is initially opened as well?

image

@YeharaDananjaya
Copy link

maybe this solution will solve your problem click

@sachin-optimizory
Copy link

sachin-optimizory commented Dec 31, 2024

Solution: Use the constructor to render the initial content that needs to be displayed.

For example:

class CustomColumnHeader {
constructor(props) {
const columnInfo = props.columnInfo;
const el = document.createElement('div');
el.className = 'custom';
el.textContent = custom_${columnInfo.header}; // Render initial content here
this.el = el;
}

getElement() {
return this.el;
}

render(props) {
this.el.textContent = custom_${props.columnInfo.header}; // Update content dynamically when needed
}
}
In this example, the content el.textContent = custom_${columnInfo.header} is rendered in the constructor initially, and we can update it dynamically in the render method. This approach resolves the issue effectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants