You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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.
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?
The text was updated successfully, but these errors were encountered: