I have created a tree containing information about server and its VMs.
I want to change the icon of VM to green if the VM is power on or to red if the VM is poweroff.
How to achieve this?
I have created a tree containing information about server and its VMs. I want
Share
Create a function to switch the tree node css class depending on if the VM is on or off.
When creating your tree, pass the iconFunc in the constructor params:
Then create css styles called VmOn and VmOff:
The store items that make up the tree nodes will need a property of VmOn or VmOff or change the iconFunc to examine the store items in a different way…