Activity Forums Salesforce® Discussions How to Hide Column Label in Salesforce Lightning Datatable?

  • Piyush

    Member
    August 13, 2019 at 3:59 am

    Hi Deepak,

    You need to filter the column to hide Column Label Lightning Datatable:-

    Let if i want to hide the phone column then use below code-

    ({
    init: function (cmp, event, helper) {
    let columns = [
    { label: 'Phone', fieldName: 'Phone', type: 'phone'},
    ];
    let mycolumns = columns.filter(col => col.label !== 'Phone');
    cmp.set('v.mycolumns',mycolumns);
    helper.getData(cmp);
    }
    })

    Thanks

    Piyush

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos