Salesforce Asked by Gaurav Sharma on December 7, 2021
I have a lightning data table with some columns and row-actions. These row actions are configured dynamically on the basis of row data. For example, If I am fetching some Payments data into my table and if the status(column) of a particular record(row) has value ‘Paid’, then the Row Actions should have ‘Refund’, ‘View Receipt’, ‘Send Receipt’ options available
otherwise if the status is ‘Failed’ the Row Actions dropdown should not be visible at all :
In my case, I am able to set the criteria for Row Actions but not able to hide the dropdown icon when there are no Row Actions. It has to be done dynamically from JS but I am not able to achieve it.
Code :
paymentsTable.html :
=========================================================
paymentsTable.js:
You are putting cellAttribute inside typeAttribute both should be separate like this
typeAttributes: { rowActions: actions},cellAttributes:{class:{fieldName:'cssClass'} }
you can also directly use "slds-hide" class instead of using static resource simply use
cssClass:'slds-hide'
Instead of "hideActionButton"
Answered by User6670 on December 7, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP