function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chikkuchikku 

How to add empty value in datatable lwc

I have created the data table and the last trow should be empty the only the total should display but automatically it assuming like undefined. URL.
I need to set an empty value, any help

User-added image

 
getTransactionWithSummery(dataValues) {
            var totalAmount = 0.00;
            if (dataValues.length > 0) {
                for (var i = 0; i < dataValues.length; i++) {
                    totalAmount += dataValues[i].Amount__c;
                }
              
           dataValues.push({Amount__c: totalAmount.toFixed(2),GuarantorName:'Total'} );
            
           }
            return dataValues;
            
        }



any help ?
AbhinavAbhinav (Salesforce Developers) 
Hi Chikku,

You can refer similar post
https://salesforce.stackexchange.com/questions/288992/lightning-datatable-displays-empty-field-as-undefined-instead-of-blank-in-lwc

Thanks!
 
chikkuchikku
Hi Abhinav,

I don't know how to use the above you given example in my code, am a new salesforce. can you help me out