mendixlabs/mendix-tree-view

Node titel not always visible when using Node title type 'Nanoflow'

Closed this issue · 2 comments

Hi,

we implemented the Tree View for a customer. One of the requirements was a color coded indicator in front of the node title to indicate the status of that tree item.

To achieve this, I used the node type nanoflow feature to change the title into a HTML string, and then style it with css:

'<div class="tree-node-indicator ' + $TreeNode/Status+ '"></div><div class="tree-node-name">' + $TreeNode/Name + '</div>'

This works, but on a regular basis, the node title is not visible. When you open an other node, the title appears.

Step 1:
image

Step 2:
image

I did debug (added log messages into the nanoflow) and see that in case this happens, for that particular tree node both attributes are available in the Nanoflow and the html output is created.

Any tips on how to address this issue?

Thanks in advance.

Greatings,

Bart

I tested this issue in our own test-project (Studio Pro 8.9) but I don't see any issues at our side. It might have to do with rerendering the nodes. As I can't reproduce the issue, I can't figure out what is going wrong. I would suggest the following:

  • Use the title that comes from the attribute instead of a nanoflow. This should work fine
  • We can add a functionality in the UI tab that gives you the possibility of adding a class name to the element itself, similar like we do in the TreeTable

If you are able to set a class name on the individual item, you can then do some CSS magic with before{} to actually render the indicator

Version 1.3.0 is released which should give you a better (CSS) solution for this styling request, as showcased in https://treeview-react-sandbox.mxapps.io/p/ui-class. Closing this issue for now.