New answers tagged

0

The property for the field name is fieldName, not field, which is why you didn't see any data. I also cleaned up unnecessary code for you. Also, please note that JavaScript is very cAsE-sEnSiTiVe. You need to make sure you capitalize everything correctly. In this case, you used type: "Email", but it should have been type: "email". I haven'...


0

You need to recreate the array using ES6 spread operator. LWC Data Table does not refresh view unless array is created. I've updated wiredContacts method with the fix. @wire (getrelatedlist, { recordId: "$recordId"}) wiredContacts({ data }) { if (data) { //recreated array using spread operator this.data = [...data]; } ...


0

I think what you potentially need is a variable to track the callout state i.e. before enqueuing the action for loadmore, check if previous loadmore call has returned. If you see the example in SF library, this is done by flipping isLoading by event.getSource().set("v.isLoading", false); Is that included in your complete code? https://developer....


3

Anything you get from an Apex call or wire method is marked as "read-only" in order to not corrupt the cache. To actually modify something, you need to make a copy of it first: const act = [...(await getAllData())].map(acti => ({...acti})); // spread object copy for(const acti of act) { acti.recordDetailUrl = await this.getRecordUrl(acti.id); }...


3

iconAlternativeText does not work as a hover text but title attribute on lightning-icon does that. Unfortunately, lightning-datatable only supports following 4 attributes to be passed in icon cellAttributes and title is not one of them - iconName iconLabel iconPosition iconAlternativeText As far as your implementation is concerned, it's working just fine. ...


2

Data bindings in LWC are always from parent to child, and never from child to parent. That is to say, it is impossible for an LWC to directly update the parent's data. You can read more about it in the @api decorator documentation. I refer to you to the LWC OSS documentation on this, as it's more complete. Technically, the only documented way to access the ...


2

This sort of behavior isn't supported in lightning-datatable. You'll want to write your own custom component if you need this sort of behavior.


1

Use getObjectInfo to get the field names and data types. You can't use lightning-datatable, though, because the types can vary in the old value/new value columns. Use lightning-formatted-date-time, etc based on the field type you get from getObjectInfo.


0

You can either remove the element with Array.prototype.splice or by way of Array.prototype.filter. this.mergeObjectList.splice(this.mergeObjectList.findIndex(row => row.Id === event.detail.row.id), 1); Or: this.mergeObjectList = this.mergeObjectList.filter(row => row.id !== event.detail.row.id);


1

First you need to retrieve the contact Ids for the different records using Apex. Then, you need to implement a clickable row in your lightning-datatable, take a look at this recipe. In the recipe it's the account name what I make clickable, but you can adapt it to be the email. Remove the target="_blank" from navigateToRecord.html so that it opens ...


1

So I ended up creating a custom column using the instruction provided in the doc - https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation Just created a new LWC component, whose JS has the customColumn defined in there and it uses: import LightningDatatable from 'lightning/datatable'; import deleteRow from './<<...


Top 50 recent answers are included