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
[New feature] TreeNode->expanded, tree, treeTable #261
Comments
would be great if the "expanded" node helps to initialize the tree expanding it at will |
I +1 this. Did one of you guys found a workaround to expand certain nodes on initialization? |
I was thinking about "faking" click events through the tree. Dirty hack?... absolutely. Does it work?, Don't know... will try it later. If someone has a better idea please let us know. |
Yeah I had the same idea @sdmoralesma but it really seems like such a dirty hack... |
Hey @sdmoralesma did you get it to work? |
Yes! I detailed here: http://stackoverflow.com/questions/38285593/how-to-initialize-primeng-tree-component/38285594#38285594 As I told you is very bruteforce trick... sorry :) |
I after update primeng, I always modifying the source code (common.ts, uitreerow.ts, uitreenode.ts) and recompile it :) |
+1 |
Additionally, it is now possible to easily address issue primefaces#682
This is available in PrimeNG 2.x. |
@cagataycivici Correct me if I am wrong, but I think expanding nodes programmatically is not yet supported by treeTable. From the merged commit e5fb29a |
@riscie I am desperate to expand and collapse nodes in treeTable (not tree) programmatically and as far as I can tell it's not working/implemented. I'm using PrimeNG 3.10.10. |
It should be supported, I will check. |
Thanks @cagataycivici . It would be very useful to know which of the following you test successfully for reference. myTreeTable . expand (node) Efforts much appreciated. |
Ok, I'm confused, when I provide a json like this by modifying showcase;
Documents node is rendered as expanded initially; So what is the issue here? If you set a node as expanded programmatically, following also works, notice that I toggle the expanded with an external button click; <button (click)="toggleNode($event)">Toggle</button>
<p-treeTable [value]="files1">
<p-header>Basic</p-header>
<p-column field="name" header="Name"></p-column>
<p-column field="size" header="Size"></p-column>
<p-column field="type" header="Type"></p-column>
</p-treeTable>
Clicking the button collapses or expands the first node (documents). |
@cagataycivici - Thank you. I now have it working. Your above example is actually clearer than the showcase.
My mistake. All good now. Incidentally, I noticed that the showcase for the 'Tree' component (not TreeTable) has a minor issue. The 'Programmatic Tree Expansion' section is not connected to the tree that is shown directly above it. It is incorrectly connected to the tree that appears in the 'Context Menu' section. If the Context Menu section is scrolled out of view, the 'Programmatic Tree Expansion' appears not to work. This had me considering giving up at one point!! ;-) |
expanded : true , property not working after angular updated to version 7 |
Hi!
Please add an "expanded" property to TreeNode, and change in UITreeRow and UITreeNode classes the "expanded" property to "node.expanded".
Thanks!
The text was updated successfully, but these errors were encountered: