New answers tagged

0

You have to implement the pagination yourself, there are several articles that could help you with this. salesforce-lightning-datatable-with-pagination lightning-datatable-with-pagination-and-search-on-the-client-side


0

I don't know what particular field you are wanting to use to link to the record, but you need two thinks for a link in a datatable - A URL Name A URL Link You need to add these after you get your results from the server. Here is one example: callGetData(yourparam){ getData({param: yourparam}) .then(result => { let resultList = []; result....


3

The first column of lightning-datatable is a th element, while all remaining columns are a td element. This is a problem for your class, because of this slds rule: .slds-table th { font-weight: 400; } Which ends up being having more specificity than your class: .slds-text-title_bold { font-size: .875rem; font-weight: 700; } So, it's not ...


0

Can you try to load in two parts and that too in renderedCallback as shown below renderedCallback(){ console.log('renderedCallback start'); if (this.dataTableScriptInitialized) { return; } this.dataTableScriptInitialized = true; loadScript(this, JqueryResource) .then(() => { console.log('then'); ...


0

You'll have to use slds html directly and use lightning-help-text base component inside the header tag instead of the lightning base component and edit the way you want it.


0

Keep a separate copy of the data, sans the total row, and then tack it on at the end. sortData(fieldName, direction){ let parseData = [...this.dataFromServer]; let keyValue = (a) => { return a[fieldName]; }; let isReverse = direction === 'asc' ? 1 : -1; parseData.sort((x, y) => { x = keyValue(x) ? keyValue(x) : ''; y = keyValue(y) ...


0

What you can do is, while selecting row for the first time, you can save them in an attribute. Say , selectedRow. When you are deselecting or selecting row again then you can check which previously selected field is deselected by comparing selectedRow with newly selected rows For example: handleSelect : function(component, event, helper) { var ...


1

Unless you want to do it server-side, which is certainly an option, you can write it as a relatively simple client-side action. First, we have to compute the ID, because the record Id won't be unique in our case. We're going to have to change each record into several rows. That means we're going to change the markup to look like: <lightning:datatable ...


0

I too face the same issue, try to use a getter, setter variable instead of directly adding if condition on the apex:column tag, and assign the value to the variable from the controller. The same I did and it worked. Example, <apex:column rendered="{!showColumn}"> <apex:facet name="header">I am Column Header</apex:...


Top 50 recent answers are included