New answers tagged

0

You need to refresh the actual wire data in order for it to work. The minimal change you should make here is: refreshLWCTable; @wire(retrieveRawData) wiredRawData(response) { this.refreshLWCTable = response; let { data, error } = response;


0

So the fix was adding the following to the Component side: <aura:attribute name="selection" type="List" /> <lightning:datatable aura:id="tblProducts" columns="{!v.productCols}" data="{!v.filteredProducts}" keyField="Id" ...


0

i added top border explicitly in lightning data table class slds-table_header-fixed_container slds-scrollable_x slds-border_top. <lightning:datatable aura:id = "cusDT" class="slds-table_header-fixed_container slds-scrollable_x slds-border_top" columns=&...


0

After retrieving data from apex, You would need to calculate a value based on your criteria & set it in the data back, such as: data.forEach(function(row) { row.Quantity = <USE_CUSTOM_FIELD_HERE>; }); If you are using wire service then you can use the wire method to populate quantity. lightning-datatable do not otherwise support expressions ...


0

You have two separate issues here. One is that you're not generating the URLs correctly: item['Id'] = '/lightning/r/Coupon__c/'+ +item['Id']+'/view'; There's a spurious + sign (+ +item['Id']) that will yield invalid results. Second, you're populating your attributes component.set("v.mapValues", arrayMapKeys); ...


0

Refer to this link and see if you can do it yourself. This is a quite easy and interesting thing. https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_table_inline_edit


0

Below I described step by step how you can do it. For more details and code you can check the following post: Custom Types in LWC Lightning Datatable Create a Custom Data Type component customTypeA/customTypeA.html <template> <a href='#' onclick={fireCustomTypeA}> CustomTypeA </a> </template> customTypeA/customTypeA.js ...


0

we ran too into this bug too in LWC, possible workaround is to query datatable object and set 'minColumnWidth' dynamically- but this will apply min width for all columns without explicitly set 'initialWidth' and assumes default min width is 50 as per documentation columnMinWidthSet = false; renderedCallback() { if(!this.columnMinWidthSet){ ...


0

You are missing the declaring the instance variables as properties in your inner class: public class consoleWrap{ public String NAME {get; set;} //ROYAL DUTCH SHELL PLC public String BVDID {get; set;} //NL34179503 public String COUNTRY_ISO_CODE {get; set;} //NL public String NACE2_CORE_CODE {get; set;} //6420 public String ...


-1

Can You update below code in your controller.It will return as expected result of Active Users. If we use IsActive=false it will return inactive users and you will get count. select Id, name, isActive,count(isActive) from User where IsActive=true groupby name;


1

On the assumption I've understood your question correctly, we have done this as follows: Extend the data table to support a custom cell data type: import LightningDatatable from 'lightning/datatable'; import matchCell from './exampleMatchCell.html'; /** * Extends the lightning-datatable component to add a custom matchScore cell type. * This custom cell ...


0

So AFAIK today, the answer is no.


0

Set rowActions to a method: { type: 'action', typeAttributes: { rowActions: this.getRowActions } Then return the actions you want in that method: getRowActions(row, doneCallback) { if(row.Status__c==='Unpublished') { doneCallback([{ label: 'Publish', name: 'publish' }]); } if(row.Status__c==='Published') { doneCallback([{ label: 'Unpublish', ...


0

try below code CONTROLLER changedRecipContact : function(component, event, helper){ component.set("v.loadScreen",true); var selectId = event.target.id; var rowInd = selectId.substring(6); var selectedContactId = document.getElementById(selectId).value; var recipientList = component.get("v.recipientList"); var selectedRecipient = ...


0

I would add an attribute and update the <select> tags; <aura:attribute name="selectedContactId" type="String"/> <!-- rest of code ommited --> <select class="selectEle" id="{!'recCo-'+recipient.rowCount}" onchange="{!c....


0

It looks like this was something to do with the markup. I originally used: <lightning-datatable key-field="Id" data={myData.data} columns={myColumns} column-widths-mode='auto' min-column-width="50" hide-checkbox-column = 'true' ...


4

The problem is due to ui:outputDate. I think its showing date in UTC. Also, it is deprecated as of API version 47.0. Consider using lightning:formattedDateTime instead of ui:outputDate. With lightning:formattedDateTime you can use the default timezone, which is the runtime environment's time zone. or you can override the default by specifying a specific time ...


5

This was a change in Summer'20 -- https://docs.releasenotes.salesforce.com/en-us/summer20/release-notes/rn_lwc_components.htm


2

There is something we do have in the slds, with the appending of single class few changes in the markup level for th and td, table will support in the desktop as well as mobile. Check here for the slds classes and styles, from the above link, Select the variants as responsive and form factor as mobile, then you will see the below attached screenshot.


0

I have added posted code in my blog where we dont need to have wrapper class https://www.salesforcepoint.com/2020/06/how-to-add-hyper-link-for-name-column.html


2

This flag is in the Summer 20 release. So that is why this would work for some orgs and not others currently. Looks like all orgs should be upgraded by mid July 20. https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_lwc_components.htm


1

To be able to get the scroll bar, set the height to the parent div. Sorting You need to add sorted-by value to your datatable. <div class="slds-form-element__control slds-m-around_medium"> <lightning-datatable key-field="Id" data={data} sorted-by={sortedBy} onsort={updateColumnSorting} columns={...


0

@PMEHTA : you can handle it in LWC js write custom logic on that. for example: use wrapper class in that and on inline edit call js function to calculate the total and restrict user to enter a value when it's greater than total.


0

The fieldName attribute on the column needs to match sortBy, assuming you have that bound to sorted-by on the datatable: To enable sorting of row data by a column label, set sortable to true for the column on which you want to enable sorting. Set sortedBy to match the fieldName attribute on the column. Clicking a column header sorts rows by ascending order ...


Top 50 recent answers are included