New answers tagged

0

The custom classes cannot be applied to cell attributes. Please refer to the salesforce ref. document. https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation


1

In lightning-datatable, the type: 'date' is considered as DateTime, while type: 'date-local' is considered as Date. I'm not sure why such naming was chosen, but see Displaying Date and Time Using Type Attributes in https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation The key difference between DateTime and Date is ...


0

You can use dataset attributes on the onclick event tag that is inside custom lightning datatable html part and use below code in JS to get Values HTML Part <button onclick={assDesk} data-stname={rec.Student_Name__c} data-id={rec.Student_Name__c} class="actions"> </button> JS Part let stdname = event.target.dataset.stname; this.name =...


0

typeAttributes: {label: { fieldName: 'Invoice_Number__c' }, target: '_top'}},


1

One way is to import each label: import labelreference from '@salesforce/label/c.labelreference'; and then you can reference the label in e.g. the columns: const columns = [ { label: labelreference, fieldName: 'name' } ];


1

Each key needs to be unique. Presumably, you're using the Id field from a record, so it should be: key-field="Id" Note that this field name is case sensitive, which is likely why you're having the problem you're experiencing.


1

If you want to preserve the ability to scroll, but hide the scrollbars, you can do that with CSS. Keep in mind this is not a good idea for accessibility because a scrollbar is an affordance that lets users know they can scroll in the first place. See an example of this CSS in action on this W3Schools example. You should be able to find several more examples ...


0

The imported field schemas are objects and not strings, but the Lightning-datatable expects the field names to be strings. Unlike the record form, it does not accept both string and schema objects. Example The import import FIRSTNAME_FIELD from '@salesforce/schema/Contact.FirstName'; will result in an object like below. { fieldApiName: 'FirstName', .....


Top 50 recent answers are included