Bug #23148 Bug Fixed

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

Version: 3.5.7 Reporter: James Catt

This is an archived bug report. If you are experiencing a similar issue, upgrade to the latest release and if that does not solve the problem, submit a new bug report

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.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases