New answers tagged

0

Yes, its possible by creating an external stylesheet i.e for eg:lwcCustomStyle.css(in this you can overwrite the css as per your needs) and storing the same in the static resource named lwcCustomStyle and then include the static resource in your LWC component.js as mentioned below. import lwcCustomStyle from '@salesforce/resourceUrl/lwcCustomStyle'; import { ...


0

Couple of suggestions: you don't need 2 apex methods, you can use 1 with a property that determins if the where clause is needed or not, for ex (this is just for reference purposes): @AuraEnabled(cacheable = true) public static List<Lead> getAllLeads(Some Property){ String query = 'some soql'; if(String.isNotBlank(Property)){ ...


0

Any updates to this problem i'm also looking for a solution to this beyond aggressive CSS editing for my LWC datatables.


1

@unique user Your JSON operation output: [{"date":"2021-06-20","description":["test1"],"amount":[30]},{"date":"2021-06-10","description":["test2","test3"],"amount":[10,10.5]}] In your output JSON above, description and amount has array of values ...


2

Your Column properties do not match the casing of your listDataForMonths properties. Javascript is Case Sensitive. make sure that the casing matches.


0

Here is the workaround I have used to inject CSS into a datatable first create a static resource called something like DatatableStyles.css that should have a css property like so. .hideCheckbox{ visibility:hidden; } Upload this to your instance of Salesforce as a new static resource and name it "DatatableStyles" (or whatever you'd like to call ...


0

Based on the issue you explained, i can think of introducing Lightning events into your architecture. If i understand your UI correctly, does it look like below? If the above understanding is right, then you might want to look at event communication in Aura available in this page. https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/...


0

You have several options: 1.- pass the row data to a parent component, which in returns passes down the data to the children components (aka, your different tabs). 2.- use something to manage your application state, such as the browser's local storage this way, your selected rows will persist across your different tabs.


2

What you're trying to do is a one-liner in JavaScript. By the way, as glls stated, you never reset the string when you add/remove elements, so it gets duplicated every time. Here's the efficient version: getSelectedData(event) { this.selectedIds = event.detail.selectedRows.map(row => row.Id).join(','); } Also note that you probably really just want ...


1

the reason you are getting duplicates is because you are simply appending id's to a string within an iteration. (your for loop) you probably want to clear the this.selectedIds at the beginning of your method to ensure you don't constantly increase the size of your string and add duplicate info.


3

The playground / lwc documentation has a clear code sample of how to get row selection(s): <lightning-datatable key-field="id" data={data} columns={columns} onrowaction={handleRowSelection}> </lightning-datatable> handleRowSelection(event){ ...


0

for me it solved with following css .datatable-full-size { width: 100% !important; } And in the html side <lightning-datatable class="datatable-full-size" key-field="Id" columns={columnsSolutions} data={solutionsList}></lightning-datatable>


0

My approach should be: Create a trigger (or a process builder) to set the Year = 1700 (or any other year) for all birthdate; Create a formula field (As string) to display the Day + Month in the format that I need.


0

You can create a separate field with just date and month and sort it in the component. Use a workflow to fill the value in the field.


0

I think the best approach is to format the birthdate in apex to just return the day as an Integer in the response alongwith other column data. The integer can then just be shown as a column which can be sorted. The table header can show the current month.


1

You would need to parse the string to convert it into the array object. component.set("v.columns",JSON.parse(event.getParam("value"))); However, your attributes datatablecolumninput and datatablevalueinput are not valid JSON strings. Please put " around the key and values.


Top 50 recent answers are included