Hi All,
I am facing a problem where i need to set font color and font width to the child nodes,
can anyone suggest me what can i do here,
Can someone help here.
Thank you,
saikumar Appana.
Hi Saikumar,
To make it work, a slight code change is required in the component module.
Code Change Path: zTreeReactive [module] > InitTreeAction [Client action] > InitTree [JS node]
JS Snippet:
function getFont(treeId, node) { return node.fontCSS ? JSON.parse(node.fontCSS) : {}; } setting.view.fontCss = Object.keys(setting.view.fontCss).length ? setting.view.fontCss : getFont;
See this demo screen: zTree_Node_Styling
Refer to the attached oml
I hope this helps you!
Kind regards,
Benjith Sam
Thank You, Benjith bro.
It is working as Required.
You're welcome, Sai
Glad to help you :)
if you supply an oml with a ZTree example, I'm sure someone will take a look.
for me, first having to build a ZTree example from scratch, which I have not used yet, is too much work.
Dorine
Hi Dorine,
this is the sample OML I created, Now I need to add color to font(Child nodes).
Saikumar Appana.
thanx for the oml,
I can't see how to make it work.
I tried traditional as well, don't see it. Maybe ask one of the authors of these components directly.
Hi @Benjith Sam ,
I have a question regarding the Ztree Demo for Traditional Apps. In the demo, we're able to insert the following string into a certain structure:
ztreeSettingsView.ztreeSettingsView.fontCss = "function (treeId, node) {return node.fontCSS ? JSON.parse(node.fontCSS) : {};}"
This assignment validates the `fontCss` parameters in the node.
I've attempted to replicate this in a reactive app, but unfortunately, it doesn't seem to work. I consistently receive the following error:
"Unexpected token 'u', ..."fontCss":function(tr"... is not valid JSON."
Upon investigation, it seems that the issue stems from the code present in `zTreeReactive.Controller.js`, specifically:
Do you have any insights on how to resolve this? I'm considering using the alternative solution you mentioned, although this isn't the only app utilizing `zTreeReactive` within the company. Therefore, I'm exploring other potential methods to address this issue.
Thanks!
Hi @João Beja,
Sharing your OML with the implemented code would be helpful for us to investigate and suggest a solution.
Additionally, since the OP already marked the post as a solution, creating a new post and attaching the oml, while linking to this post for reference, would be beneficial for the community and the asset team to offer assistance and explore alternative solutions.