formio / formio.js

JavaScript powered Forms with JSON Form Builder

Home Page:https://formio.github.io/formio.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EditGrid not showing view icons in readOnly mode

llaurentiu opened this issue · comments

For edit grids, we are using a custom template for the edit grid rows template so that, if the grid is read only, we show a different icon - iconClass('eye'). Clicking this icon opens the clicked row so that we can view the row details (grid can be complex so not everything is visible in the grid columns). See the row template below.

The html template for the button makes use of the same 'editRow' event that is attached to the button. Using this class is the only way to attach the event.

`...
{ % if (instance.options.readOnly) { % }

  //editRow is the class to which the EditGrid component attaches the click event.
  <div class="btn btn-default btn-light btn-sm editRow">

    <i class="{{ iconClass('eye') }}"></i>

  </div>

</div>
...

`

This was working fine, prior to this change #4850 - which removes the row events completely if grid is readOnly.

Instead of creating a new event for viewing the data (which is not backward compatible) - we should just amend the new condition to be applied for the PDF converter.