Ag-grid: inserting cell break line

Hi,

I am trying to break line in my custom DAG function. Instead of wanted behavior I only get

<br/> written as literal string in my grid.

I use this function with my grid groupings in order to show text in grouped row as well as child rows.

Any way to achive line break in this case?

dagfuncs.genericValueGetter = function(columnName, params) {
  if (params.node && params.node.group) {
    let distinctValues = new Set();

    for (let child of params.node.childrenAfterGroup) {
      distinctValues.add(child.data[columnName]);
    }

    return [...distinctValues].join("<br/>");
  } else {
    return params.data[columnName];
  }
};

Ah, I see all 3 were needed: \n, cell renderer as markdown and autoheight to make it work.

Hello @davzup89,

For markdown, to break a line you need to use:

<space><space><line break>

1 Like