Created
May 7, 2020 16:54
-
-
Save loktevich/1cd135d1d7a0f7862724a7df920cd786 to your computer and use it in GitHub Desktop.
LWC. Possible way to remove header action buttons from lightning-datatable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rendered callback adds style element that hides standard action buttons | |
renderedCallback() { | |
if (!this.hasRendered) { | |
const style = document.createElement("style"); | |
style.innerText = | |
"c-my-component lightning-datatable .slds-th__action-button {display: none;}"; | |
this.template | |
.querySelector("lightning-datatable") | |
.appendChild(style); | |
this.hasRendered = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For advanced styling you can use this approach to load entire CSS file.