multiple treecheckbox columns in treetable

Hi,

I have got an issue with treetable view having multiple columns of type treecheckbox. I have set the threestate attribute as true, and using the common.treecheckbox() template. So if I check the parent checkbox of any column for a particular row, then all the parent checkboxes of other columns for that row also get checked, correspondingly checking the child checkboxes also. What I need is, only the child checkboxes for the parent checkbox column should get checked.

Can you suggest a solution for this requirement.

Code: http://webix.com/snippet/27084d28

Also, is there a way by which I can identify a column by using the id of the checkbox.

Thanks,

AP

treecheckbox is hardcoded to use “checked” attribute for storing its state. So all columns are sharing the same value, changing in one will be reflected in others.

You can use common.checkbox, but result view will lost ability to check all child items by clicking on a parent item.

http://webix.com/snippet/f3558487

You can use onCheck event and from it call this.data.eachChild to iterate through all child nodes and change their state

http://docs.webix.com/api__link__ui.treetable_oncheck_event.html
http://docs.webix.com/api__treestore_eachchild.html

so is there a custom way to iterate through each child elements for the column whose parent checkbox was checked? what I intend to implement is the threestate functionality on each column of the treetable view but they should be independent of each other.

Hi @Maksim , I encountered the same problem of Anil, and as you suggested i implemented a sistem like “three state”:
-If node that has some child and is checked(marked) all the sons will be checked, obiviously if i remove the check from a child the the parent will be unchecked.
Still remains a problem, how create the third state “the little black point” inside the “top level” checkbox of the node that has only some child nodes checked.

Do you have any idea how to do this?

Hello @francesco_talin ,

Try this sample ( threeState: true ): https://snippet.webix.com/vxbl70np
Maybe it help you to solve the problem

Hello @Nastja ! I saw yor example but still remains the problem because the three state treetable “work” by record and not by column.

In this example i reproduced in “small size” my problem: Code Snippet

I have a list of user in a list (not included into the example) and for each user i can modify the permissions that a the user can have about (for example) Alarms.
Note, the alarms are grouped into Categories (if you have a lot of alarms is more simple to organize and make the same selection for all elems of same group). Now, the problem is if i check the “Alarm group 1” (see the example) at the level of “Modify” column the selection is replicated on the “Deactivate” column and not only the sub elements of “Modify”.

I’m doing something wrong?

Tree checkboxes are designed for working with UI Tree, and we assume that there can be only one chain of such checkboxes per component.

So I advice you to start from this snippet: https://snippet.webix.com/f3558487

And using the onCheck event and TreeStore iterators check and uncheck parent and child nodes.