You need to sign in to do that
Don't have an account?
ligthning:dataTable not displaying correctly
Hello ,
I have a ligthning:dataTable not displaying correctly.
There is no header visible and also data is not visible.
Please explain why.
I have a ligthning:dataTable not displaying correctly.
There is no header visible and also data is not visible.
Please explain why.
<aura:if isTrue="{!v.showCsResults}"> <lightning:datatable data="{!v.csResults}" columns="{!v.csResultsColumns}" keyField="siret" hideCheckboxColumn="true" onrowaction="{!c.siretiser}" /> </aura:if>
init: function (component, event, helper) { //This method is called on initialization //It formats the lightning:dataTable that will display the CS results with the appropriate columns and data types var actions = [ { label: 'Sirétiser', name: 'siretiser' }, ]; component.set('v.csResultsColumns', [ {label: 'Siret', fieldName: 'siret', type: 'text'}, {label: 'Nom du Compte', fieldName: 'nomCompte', type: 'text'}, {label: 'Rue', fieldName: 'rue', type: 'text'}, {label: 'CP', fieldName: 'cp', type: 'text'}, {label: 'Ville', fieldName: 'ville', type: 'text'}, { type: 'action', typeAttributes: { rowActions: actions } } ]); }
var csresults = new Array(); for (var item of results.companies) { var csresult = new Object(); csresult.siret = item.regNo; csresult.nomCompte = item.name; csresult.rue = item.address.street; csresult.cp = item.address.postalCode; csresult.ville = item.address.city; csresults.push(csresult); } component.set('v.csResults', csresults); component.set('v.showCsResults', true);
issue is with UI please provide your css too
try these CSS component as
Mark as resloved if it helps :) :)
Thanks,
Bhanu Prakash
visit ForceLearn.com