-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"undefined" values of markdown columns during grouping #171
Comments
Yes. A group renderer is different than a regular cellRenderer. A workaround is to use dcc_markdown as a custom renderer designed to only render when there is a params.value. |
Can you share an example of dcc_markdown renderer usage? I can't find it in documentations. |
You can check out examples here. Also, could you please post this on the community forums? |
I've played a bit with custom renderers and what I got. The snippet below works for pure Markdown but ignores let dagComponentFuncs = window.dashAgGridComponentFunctions = window.dashAgGridComponentFunctions || {};
dagComponentFuncs.DCC_Markdown = function (props) {
if (props.value == null) {
return "";
}
return React.createElement(
window.dash_core_components.Markdown,
{
dangerously_allow_html: props.dangerously_allow_code,
},
props.value
);
}; But it's not suitable for us because we use let dagComponentFuncs = window.dashAgGridComponentFunctions = window.dashAgGridComponentFunctions || {};
dagComponentFuncs.htmlRenderer = function (props) {
if (props.value == null) {
return "";
}
return React.createElement('div', {
dangerouslySetInnerHTML: { __html: props.value }
});
}; And it works, but I feel that both ways (markdown / htmlRenderer) look like kinda dirty hack. Probably, we have to implement custom renderers for each case, e.g. |
Hello @roman-kachanovsky, DCC_Markdown should be working with allowing the html... which it is not, this is actually a separate issue. I can update the I really recommend trying to stray away from using raw_html inside of the grid, there is tons of flexibility with all the custom components that you can make. For example:
This creates a link to yahoo with just the ticker being in the cell, the major benefit of this is that you can export your data to csv and excel without all the markdown or html info. Here is an easier way to do the markdown component as well:
Notice the To pass the
|
Thanks @BSd3v I really appreciate your advices. Actually, we are happy that dash-ag-grid now provides an opportunity to extend its functionality using js functions in natural way. We had some ugly formatters before, for example, and even broken table filter due we couldn't attach correct comparator, but now we can fix and improve all that stuff. |
You're welcome. We tried to give as much freedom as because AG grid has so many features. |
If table contains columns with
cellRenderer="markdown"
these columns show "undefined" values in group headers regardless of which columns are used for grouping.Code snippet:
Result:
The text was updated successfully, but these errors were encountered: