2

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
            modifiedCols.push(field.fieldApi);
            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;
        columns.push(obj);
    })

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? – Sergio Alcocer May 22 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. – Rajendra Singh Nagar May 22 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 – Sergio Alcocer May 22 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/… – Rajendra Singh Nagar May 22 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) – Sergio Alcocer May 22 at 9:57
2

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.

https://releasenotes.docs.salesforce.com/en-us/summer20/release-notes/rn_lwc_components.htm

| improve this answer | |

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.