You need to sign in to do that
Don't have an account?
sesha boddapati
In lightning web components how to display records using table
Hi All,
Help me this, how to display records in lightning web components.using <table> tag.. import from apex class..
Thanks, Sesha.
Help me this, how to display records in lightning web components.using <table> tag.. import from apex class..
Thanks, Sesha.
Maybe this can help you:
Javascript file:
ControllerLwcExample.cls file:
HTML file:
References:
https://salesforce.stackexchange.com/questions/284842/lwc-inside-an-html-template-for-loop-set-loop-variable-property-to-new-user-ty
https://salesforce.stackexchange.com/questions/251934/iterate-over-object-in-lightning-web-component-template
All Answers
Controller ControllerLwcExample.cls should be: Javascript file should be: And HTML:
Also can send the data without a Wrapper Class, just returning a list of the object if you want. For more information, you can visit next pages:
To create a Lightning Component, there are many options.
https://www.lightningdesignsystem.com/components/data-tables/#site-main-content
This shows several examples. Here is one:
In order to customize this, you should replace all of those non-head <tr> items with an aura:iteration section that uses your data resource
Here is an example:
Keep in mind that if you just copy/paste this code, it definitely won't work, but intuitively, it'll be something like this.
Thanks for Reply... I am done with display records using <lightning-datatable>...
using <table> to display records...
for example in lightning aura components, we are displaying records using <lightning:datatable> and using <table> table tag in slds..
i.e Is it possible to display records using <table> tag using Apex controller...
Thanks, Sesha.
Thanks for Reply.... I need to fetch records from Apex class..Is it posible to get records from databse...
Thanks, Sesha.
Maybe this can help you:
Javascript file:
ControllerLwcExample.cls file:
HTML file:
References:
https://salesforce.stackexchange.com/questions/284842/lwc-inside-an-html-template-for-loop-set-loop-variable-property-to-new-user-ty
https://salesforce.stackexchange.com/questions/251934/iterate-over-object-in-lightning-web-component-template