Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lightning-datatable]

A table that displays columns of data within lightning experience, formatted according to type. This component requires API version 41.0 and later.

0
votes
0answers
28 views

lightning-tree-grid link to js function?

I'm working on an lwc that has a lightning-tree-grid (nested datatable). I've made it so the name column is type:url with a link to the record. That works, but it's not really what I want to happen. I'...
0
votes
1answer
21 views

Hide the default row number from 1st column

I need to remove the 1st column from the lightning table which is the row number but not able to do it. My .cmp looks as follows <aura:attribute name="recordId" type="Id" /> <aura:attribute ...
0
votes
1answer
34 views

How to get unchecked row/checkbox value in lightning:datatable

I am using <lightning:datatable onrowselection="{!c.onSelectContact}" /> for displaying contacts and to check and uncheck checkbox fields. Then in the component controller i use event.getParam(...
3
votes
0answers
37 views

Lightning datatable not loading data when scrolled to the bottom

I have created a lightning component which has a lightning:datatable that loads more data as I scroll down. The data loads fine when I use the component explicitly in an app. In the below picture ...
5
votes
1answer
87 views

Can we specify a minimum height for a lightning:datatable/lightning-datatable?

Problem lightning:datatable (rendered as a lightning-datatable) places itself in a wrapper that is only exactly as big as it needs to be. If you click on a header-level action in a table with no rows,...
0
votes
0answers
59 views

Lightning:datatable dynamically disable checkbox per row

I have a lightning:datatable component <lightning:datatable columns="{!v.columnsPhone}" data="{!v.dataPhone}" keyField="id" ...
1
vote
1answer
48 views

Is there a way to insert a <div> right below a datatable row?

I need to put a div right below a lightning:datatable row. Is there a way ?
0
votes
1answer
55 views

lightning:datatable boolean type inline editing

https://developer.salesforce.com/docs/component-library/bundle/lightning:datatable/documentation As per the above document, lightning:datatable does support boolean type. But, it didn't say anything ...
1
vote
1answer
64 views

Displaying multiple errors in lightning:datatable

As per below salesforce documentation we can display error for lightning datatable by setting the "error" attribute. https://developer.salesforce.com/docs/component-library/bundle/lightning:datatable/...
0
votes
1answer
26 views

Get column header label while sorting a lightning:datatable column

As per the salesforce official doc, when we sort a column, we can get the field name by using var fieldName = event.getParam('fieldName'); https://developer.salesforce.com/docs/component-library/...
0
votes
1answer
194 views

Change cell text color based on cell value in lightning:datatable [duplicate]

Can we change the cell text color based on value? for example: if a cell value is "Active" then make the color green, if not then make it red. I have checked cellAttribute for lightning:datatable ...
0
votes
0answers
93 views

How do I put slds-scrollable horizontal scroll at bottom of table (instead of bottom of page)?

I have a lightning:datatable component which has quite a lot of columns, where we want the user to scroll horizontally. The horizontal scrollbar is fixed to the bottom of the page. I would like to ...
3
votes
2answers
164 views

How do you center align the text of the column headings for a lightning:datatable?

I'm able to apply color or make the column heading text bold, but I can't center align the text for some reason. <lightning:datatable data="{! v.data }" columns="{! v.columns }" ...
0
votes
1answer
212 views

Can we add bold style to last row in Lighitng Data table??

I am using "lightning:datatable" tag to display set of rows in UI. Few columns are numeric data. I needed last row to be summarized values of all the data set. I don't find any standard summary ...
5
votes
1answer
221 views

Static values for `<lightning:datatable>`

I've got a working datatable using the following in my component markup: <lightning:datatable columns="{!v.columns}" data="{!v.configuration.channels}" keyField="channelId"/> Columns is a List ...
0
votes
1answer
121 views

Rendering data from Wrapper Class into Lightning Data table

Hi I'm trying to render data from a wrapper class it's coming up with row but values are empty. Component: <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,...
1
vote
0answers
22 views

Calling a lightning component when user clicks on url type cell in lightning:datatable

I have a lightning:datatable which have a few columns. The first column is of type url. <lightning:datatable columns = {!v.columns}" data="{!v.data}" keyField="Id" ...
1
vote
1answer
76 views

Datatable inline lookup editing

As showed here we can easily implement an inline editing of a data table. Now I will need to have this editable field to behave like a lookup field and not a normal text field. Is this possible? ...
0
votes
0answers
33 views

Is there an option to handle lightning:datatable OnRowClick event? [duplicate]

My initial requirement is to provide a user with an ability to select one option from the list of data. The list should display a dynamically built table with different columns (String/Date/Boolean). ...
1
vote
1answer
197 views

Show Save and Cancel buttons always on lightning datatable

I have a situation where I need to show Save and Cancel buttons on lightning datatable (inline edit) always. However, unless I edit some field the Save button will not appear. I am displaying the ...
0
votes
2answers
227 views

Is it possible to display 15,000 records in lightning component?

In contact object, we have 15,000 records. I want to display them into a lightning component. Functionality : Need to load 15,000(maybe more) records. Need to provide pagination. Need to Provide ...
1
vote
1answer
129 views

Nested / multi level lighting:datable

I'm looking to see (If it is even possible) to create a multi level lightning datatable. I.E. The parent object has a tickbox in table element 0, If selected a sublevel opens and you can see the ...
3
votes
1answer
86 views

Dynamic Button Icons in a Data Table Similar to Dynamic Actions in a Data Table

It's possible to have actions for each row in a data table that change depending on the contents of the rows (that are changed by those very actions). For example: The component reference provides ...
5
votes
0answers
89 views

How to handle percentage factor of 100 problems when using lightning:input and lightning:datatable?

When working on a bug, I just noticed that lighting:input now supports two percentage formatters, where the older one percent expects the user to know to enter e.g. 0.5 for 50%: <lightning:input ...
0
votes
1answer
803 views

Using wrapper Class in Lightning:Datatable

I am trying to set the data of the Lightning:Datatable from the wrapper class in server-side Controller. public class AccountWrapper{ @AuraEnabled public Account acct {get;set;} ...
0
votes
1answer
434 views

Lightning datatable record shows url of related record

I need to create an activity table like standard look and feel. I got stuck at two point 1.whoid/contact name isn't coming as per need I need to create dummy checkbox field for event Component: &...
0
votes
1answer
825 views

How do we use 'button-icon' column in lightning:datatable?

I'm trying to add button-icon column to my lightning:datatable, but it does not display any icon and simply a blank cell is rendered. I fail to see what I might be doing wrong here. Can someone guide ...
0
votes
1answer
395 views

Hide checkbox column and color some rows of lightning-datatable [duplicate]

I have data of customers and their numbers. I want to show it in dataTable. Additionally, I am trying to color those rows whose numbers are invalid and also disable the checkbox for that row. I have ...
0
votes
0answers
11 views

lightning:datatable - Want a column that looks like an URL but fires onrowaction [duplicate]

Is there any way to add a column to a lightning:datatable that looks like a colum of type "url" but instead of navigation when its click it fires onrowaction so that I can do something (other than ...
1
vote
1answer
720 views

Lightning:datatable number formatting

I have created a lightning:datatable to display order lines. The order lines are fetched via a REST call. I parse the JSON response and add to the datatable data attribute. Everything works fine but ...
2
votes
1answer
217 views

Deleting record associated with a lightning:datatable row - Use LDS or APEX Controller?

What is the recommended method of deleting a record associated with a row in a lightning:datatable? All the examples I see show to make a call to an Apex controller to do the delete (maybe I should ...
1
vote
1answer
326 views

Insert a link in lightning datatable Column Value

I am trying to insert a link in a result column of lightning:datatable Below is the code snippet : Datatable Code: <lightning:datatable data="{! v.contactList }" columns="{...
0
votes
1answer
293 views

Lightning Datatable row selection issue in Pagination

I am using the lightning:datatable component along with the pagination, the issue i am facing is that when we select a specific row/rows and go to next pagination page , then the previous sleccted ...
7
votes
1answer
209 views

How do I get lightning:datatable to do some undocumented thing X?

Canonical Question I want to do <some really cool thing> with a lightning:datatable, but I can't seem to figure out how to do it. I checked the documentation, but I did not see a way to ...
0
votes
1answer
437 views

lightning:datatable set columns dynamicaly

init: function (cmp, event, helper) { var columns = '[{"label": "Rank", "fieldName": "rank", "type": "text","initialWidth": "70"},{"label": "Advocate", "fieldName": "advocateName", "type": "text", "...
1
vote
1answer
302 views

Picklist type inline editing in lightning:dataTable

I have a situation where I need to edit contents of lightning:dataTable and editing should be done from a picklist and not from edit box. I have seen many examples where custom inline Editors are ...
1
vote
1answer
130 views

Url field type is not working in Lightning data table

I have this field definition in a lightning datatable: { "fieldName": "Id", "initialWidth": "150", "label": "Case Number", "sortable": true, "type": "url", "typeAttributes": { "label"...
0
votes
1answer
232 views

I want to access <tr> and <td> element of lightning:datatable in lightning component?

Actually, I want to access TD and TR element in my JS Controller for further processing. " table = document.getElementsById("myTable"); console.log(table);" this line causes an error, if I use a ...
5
votes
0answers
171 views

lightning:dataTable in a multi-currency org

Trying to figure out how to handle records with multiple currency. The dataTable definitions are for the column. I do not see anywhere in the documentation where the currency code of an individual row ...
1
vote
0answers
83 views

lightning:datatable table headers are disappearing in iPad safari browser

I am using lightning:datatable, the table headers are disappearing in iPad safari browser when I try to resize the coloum headers by draging. Please help me in resolving this.
1
vote
3answers
595 views

Conditionally Render Button in lightning:datatable

We are using the (simplified) component/controller below but we want the view button to conditionally render. E.g. When record.boolean__c = true. Is there a way to do this using the lightning:...
1
vote
1answer
362 views

Editable lightning:datatable with Lightning Data Service?

Its it possible to rig up editable lightning:datatable to do saves via lightning data service? In the few samples (very few) saves requests are sent to an APEX controller that you need to write. ...
0
votes
2answers
316 views

lightning:dataTable action column is not rendering properly [duplicate]

I have added a lightning:dataTable within like this <lightning:card title="My Table" iconName="standard:contact"> <p class="slds-p-horizontal_small"> <lightning:...
1
vote
2answers
184 views

How to insert a component into a lightning: datatable component row

I need to create a table and would like to use the ligthingdatatable component. In jqueryDataTable I can put an inline component in the table. But how do I do this for lightning: datatable?
0
votes
1answer
188 views

lightning:datatable action menu error

I'm showing a datatable with a list of opportunities. Now I want to allow for a dropdown menu of actions. When I click on the arrow to the left of the opportunity detail row, it is giving me this ...
1
vote
1answer
484 views

lightning:datatable won't populate with data inside aura:iteration

I have an iteration to set up datatables in slds accordions in my lightning component: <ul class="slds-accordion"> <aura:iteration items="{!v.definitionObjects}" var="objStats"> ...
1
vote
1answer
142 views

$A.get('e.force:refreshView').fire(); for Save funtionality is not working in case of Lightning:dataTable

I want to refresh the view whenever I click on Save button, it should update datatable with newly updated values, but still shows old value. Though update works fine in back-end. Please find code ...
1
vote
1answer
733 views

Update is not working in Inline Editing for Lightning:dataTable

I am trying to update data in inline editing, here I used Lightning:dataTable. As of now, I am not able to capture newly updated data, means the update is not working. Please find the code below: ...
0
votes
1answer
34 views

Static ID works in JS but doesn't work if I take value from Apex Controller?

I want to have pre-selected checkbox for inline editing in Lightning:dataTable tag. So if I am using hard-coded value for ID (i.e. static value) to set value for selectedRows attribute (regarding ...
0
votes
0answers
278 views

Sorting on Reference and Date field in lightning data table

I am displaying task records using lightning datatable in a lightning component. This table contains task records with 2 columns: DueDate (date) and Related To (Account). When the component is loaded ...