Is it possible to fetch records automatically from database just by mentioning columns?
Also can we use relationship fields to get data without any processing?
For example CreatedBy.Name
?
Other features like sorting, pagination etc?
Is it possible to fetch records automatically from database just by mentioning columns?
Also can we use relationship fields to get data without any processing?
For example CreatedBy.Name
?
Other features like sorting, pagination etc?
Best Answer
Generic component which has following features: (This can be used in both AURA and LWC parent component)
You can find the component here: https://github.com/sasank-sfdcdev/public/tree/master/src/lwc/datatable
The simplicity of this is such that, you can just put tag, and rest of the things is done by it. Example HTML:
and its JS:
NOTE: You need add
api
property incolumns
which will be used to fetch data from database.Here is how it will render:
Here is the sample of AURA component:
and
controller.js
,