EnhancedLightningGrid icon indicating copy to clipboard operation
EnhancedLightningGrid copied to clipboard

Wrap & Clip text options missing

Open romcode opened this issue 7 years ago • 4 comments

Hi, it seems is not possible to wrap (or clip) the text of each column, as lighting tables do (see attached image)

It would be great if this is an option for the end user (drop menu in each column, as lighting standard) and also an option for each field configuration "predefined" mode.

Please, note that for the "clip" text option, a "tooltip" of uncutted text would be great. This is something that salesforce does not have at all in any table, but maybe is not so complicate in your component inside the sdgDatagridCell.cmp sub-component.

Best regards and thank you for your great effort!!!

image

romcode avatar Jul 02 '18 16:07 romcode

love this app! agreed this would be awesome for longer text fields to have word wrap or clip options enabled

cgrinter avatar Dec 04 '18 23:12 cgrinter

This is actually critical for us as one of the fields is a huge long link, and when putting it in the right side of a lightning record page (below where activity history is), every other field is not viewable unless scrolling way to the right.

sbaar avatar Mar 11 '19 21:03 sbaar

In case this is helpful, a workaround we did was

  1. Use an apex-based data source rather than the sortable data grid, and
  2. Apply CSS to the data that is returned and displayed by the Enhanced LightningGrid

If you haven't experimented with using apex as a data source yet, I can't quite help with that part - but if you have, here's a code example that worked for us:

// query the data
result.data = (List<yourObjectType>) database.query(query);

// data manipulation
for (SObject o : result.data) {
    yourObjectType r = (yourObjectType) o;

    // apply word wrapping
    if (r.Description != null) {
        r.Description = '<div style=\'word-wrap: normal; white-space: normal !important;\'>' + r.Description + '</div>';
    }
}

justinclarke-sc avatar May 17 '20 12:05 justinclarke-sc

Are there any plans to address this or workarounds without using apex?

danm4m avatar Feb 23 '22 15:02 danm4m