|
Title: custom 3 state tree check boxes Post by: devnull on January 30, 2015, 01:07:33 AM I am using a tree to control user access to the screens, the tree is attached to a user, and the user gets access to the tree items that are checked.
It works very well, but now I need to use the same tree to specify whether the access is read-only or full write access. So my idea is to somehow change the tree-check icons for ones that represent read-only, read-write and no access (un-checked). So each time you click the checkbox it would cycle through [ read-only, read-write, no-access ] Is this possible to achieve relatively easy and will I be able to differentiate between the different check-type in the data ? Title: Re: custom 3 state tree check boxes Post by: jarry on January 30, 2015, 06:14:21 AM Please refer to the code below:
Code: $('#tt').tree({Use a 'flag' property to represent the current node state(read-only,read-write,no access). Use the 'formatter' function to display the node's checkbox regarding its flag. Click a un-checked node, the node will be checked. Click it again, it will be indeterminate. etc. |