I have a requirement where i need to hide "wrap text and clip text" default action options in lightning datatable. However, it doesn't seems to work for me. Actually, tried a lot of permutations and combinations apart from what mentioned in documentation. https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation

Sample code that i am using:

fieldInfo.forEach(function (field) {
        let obj = {};
        obj.label = field.fieldLabel;
        // Check for reference fields.
        if (field.fieldApi.indexOf('.') !== -1) {//If exists
            field.fieldApi = field.fieldApi.replace('.', '');
        obj.fieldName = field.fieldApi;
        obj.iconName = 'utility:date_time';
        obj.type = field.fieldType;
        obj.typeAttributes = {
            currencyCode: 'EUR'
        obj.hideDefaultActions= true;

Is there anyone for whom this worked ? Checked on stackExchange (check below comments), it is not working for others as well ? Is this a bug?

  • It is working for me. Can you paste some more code or paste a playground link with sample code that shows your issue? May 22 '20 at 9:26
  • Well that weird, Actually i have a lot of code that i can't put here. However, i will cross check with sample codes in playground again. And, if it still doesn't work, will give playground link. May 22 '20 at 9:27
  • for example, on this one (from the doc) developer.salesforce.com/docs/component-library/tools/… you can modify the header in withRowActions.js to get { label: 'Name', fieldName: 'name', hideDefaultActions : true }, and it works May 22 '20 at 9:30
  • On click of header, i am getting this error. "TypeError: element.getAttribute is not a function" The same is happening on my playground as well. developer.salesforce.com/docs/component-library/tools/… May 22 '20 at 9:49
  • That's odd, Its working for me (I just removed your //). Can you try with a different browser? (maybe is a browser / version issue) May 22 '20 at 9:57

This flag is in the Summer 20 release. So that is why this would work for some orgs and not others currently. Looks like all orgs should be upgraded by mid July 20.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.