MIGX icon indicating copy to clipboard operation
MIGX copied to clipboard

3.0.0-alpha5 - HTML from richtext not parsed in MIGX grid

Open deJaya opened this issue 3 years ago • 1 comments

MIGX richtext fields [with no renderer selected for the column] no longer render with their rich text formatting in the grid columns:

image

Choosing the renderFirst renderer for richtext columns seems to work as a workaround although I'm not sure what that actually does or what other implications there might be from using it.

deJaya avatar May 20 '22 14:05 deJaya

I believe this is a problem with MODX 3 (and not with MIGX). There's a similar issue with the Collections extra.


The renderFirst renderer splits the value by the : character and returns the first part.

https://github.com/Bruno17/MIGX/blob/b14c5abdb5503095b18975b391ef2615811c63aa/core/components/migx/configs/grid/grid.renderer.inc.php#L62-L64

So if there is a : in your Event Description, then not all the text is displayed.


To avoid this you could create a custom renderer:

  • Create a file grid.config.inc.php in core/components/somepackagename/migxconfigs/grid.
  • Add code for your custom renderer to this file:
<?php
$renderer['this.renderMarkup'] = "
renderMarkup : function(val, md, rec, row, col, s) {
    return val;
}
";
?>
  • In your config in the tab "MIGXdb-Settings" set the field "Package" to somepackagename.
  • In the tab "Columns" select your custom renderer ("this.renderMarkup") from the list.

halftrainedharry avatar Aug 18 '22 09:08 halftrainedharry