Why is data not showing in lighting DataTable?

Why is data not showing in lighting DataTable?

I am fetching UserLicenses data and binding into the lighting dataTable, data is coming fine from the apex controller but not display in the lighting:dataTable.

Why is the table blank in Lightning aura?

Table columns are blank. You need to return List instead of List of String because in Datatable it always looks for the fieldName in the List that you are binding with data attribute. For example, in question, you are providing the fieldName as Name but in response, it will get the value for Name while it should look like Name = ‘Standard’.

Why do you return list instead of string in DataTable?

You need to return List instead of List of String because in Datatable it always looks for the fieldName in the List that you are binding with data attribute. For example, in question, you are providing the fieldName as Name but in response, it will get the value for Name while it should look like Name = ‘Standard’. Try below code for apex class

How does the Lightning DataTable work in Salesforce?

A table that displays rows and columns of data. A lightning-datatable component displays tabular data where each column can be displayed based on the data type. For example, an email address is displayed as a hyperlink with the mailto: URL scheme by specifying the email type. The default type is text.

How to get list of contacts in Lightning DataTable?

The last two columns are displayed as hyperlinks to represent an email address and telephone number. To return a simple list of records, use the getListUi wire adapter. To select certain accounts using SOQL, use an Apex method. See Call Apex Methods. This example loads the first 10 contacts in the datatable using a SOQL query.

How to hide checkbox in lightning data table?

This example creates a table whose first column displays a checkbox for row selection. The checkbox column is displayed by default, and you can hide it by adding hide-checkbox-column in your markup. Selecting the checkbox selects the entire row of data and triggers the onrowselection event handler.