Bug #23148 Bug Fixed

Inconsistent method for setting grid column width on new vs existing rows

Version: 3.5.7 Reporter: James Catt

EE 3.5.7 introduced a fix for the non-function column width setting for grid fields (thanks for this!).

Unfortunately, I’ve discovered the width is being set improperly when adding new rows.

Pre-existing grid rows are having the width set as a percentage applied via <td width="XX%">, which I believe is the expected behaviour. However, new grid rows are getting the number applied as a pixel-based min-width.

For clarity, if I set a column’s width to “20” in the grid field options, here’s a sample output from a pre-existing row entry:

<td class="required" data-fieldtype="text" data-column-id="33" data-row-id="2361" width="20%">

…meanwhile new row entries are output as follows:

<td class="invalid" data-fieldtype="text" data-column-id="33"  20px" data-new-row-id="new_row_11">

Perhaps this is a result of the front-end JS applying the inline style without properly setting it as a percentage?

Note that once you save the entry and reload the editor, the field will output as per the first example, since presumably it’s being rendered server-side.

  • It looks like my second code sample got garbled. After the

    data-column-id

    there’s an inline style parameter setting

    min-width: 20px

    .

    James Catt
    14th June, 2017 at 4:08pm
  • Thanks for the report, this is fixed for the next release!

    Relates to: #21340

    Derek Jones
    14th June, 2017 at 4:13pm
  • That was fast! Cheers! smile

    James Catt
    14th June, 2017 at 4:15pm

You must be signed in to comment on a bug report.

ExpressionEngine News

#eecms, #events, #releases