Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ajax loaded data parent detection #12

Closed
pajooh opened this issue Mar 17, 2014 · 4 comments
Closed

ajax loaded data parent detection #12

pajooh opened this issue Mar 17, 2014 · 4 comments

Comments

@pajooh
Copy link

pajooh commented Mar 17, 2014

in a tree that nodes are loaded asynchronously (e.g. by clicking on parent node),
every node initially is considered as leaf, as it has no children loaded.
as a workaround, it can be another property like is_parent, to indicate parent nodes from leafs.

@yoavaa
Copy link
Contributor

yoavaa commented Mar 18, 2014

I am not sure I understand the issue.
The tree should be update as you update the model - reflecting the change in the tree DOM based on the change in the data.

Can you share a gist / fiddle to demonstrate the problem?

@pajooh
Copy link
Author

pajooh commented Mar 18, 2014

the tree updates as excepted, but the problem is what icon (leaf/expandable) to show
initially, as every top level node has no children, every node is treated as a leaf (with leaf icon). clicking on each node will load it's children and the clicked node icon changes to expandable icon

i 'm talking about making a node with expandable icon even without any children loaded

@yoavaa
Copy link
Contributor

yoavaa commented Mar 23, 2014

got it. will have to think how to support such a use case.

@yoavaa
Copy link
Contributor

yoavaa commented Apr 7, 2014

implemented a solution isLeaf method in options - which allows you to select if a node is a leaf or a branch. The method accepts a node and returns boolean.

@yoavaa yoavaa closed this as completed Apr 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants