You need to sign in to do that
Don't have an account?
How to make a generic datatable component
Hello everyone.
I need to create a custom RecordList table which is using a custom ListView.
In order to do that I have created a LWC using lightning-datable just like in the Apex to Work with Data unit from Trailhead (https://trailhead.salesforce.com/content/learn/modules/lightning-web-components-and-salesforce-data/use-apex-to-work-with-data).
I would like to reuse this LWC to display different Objects' records instead of creating different component for each Object. Is it possible to use ListView for so I can get the columns automatically as well ?
I am fairly new to SalesForce development, I hope I am making sense. Thanks in advance for your help.
You can try implementing an example given on below link:
https://newstechnologystuff.com/2019/04/07/display-generic-sobject-in-lightning-web-components/
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.
All Answers
You can try implementing an example given on below link:
https://newstechnologystuff.com/2019/04/07/display-generic-sobject-in-lightning-web-components/
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.
The idea is to simplify the usage of mat-table by creating a custom component that takes just the ‘path’ and the required ‘columns’ to be displayed.No more touching the ts code to manage your columns, or no need to duplicate the component logic for every mat-table you put in your application.We should be able to just drop the 2 liner html code where ever you need to display a table in your application.