PDA

View Full Version : Tree List -Display the root as same Treepanel



Vamsi
Oct 20, 2020, 2:25 PM
Hi,

We have two options one is treepanel and treelist.

Here I'm going with treelist and I need to display as below using Treelist but I can able to display using TrePanel.


25453

My requirement is only one root (which is parent root) which expands the sub nodes.


Thank you,
Vamsi,

fabricio.murta
Oct 20, 2020, 5:43 PM
Hello @vamsi!

The tree list component always take a root node, it is just as a reference to derive the remaining child nodes. If you want to have a single node displayed in the tree list all you need to do is keep a single node within the root node.

In case you have both a tree panel and tree list in the same page that shares the same store, just follow the same technique and set the tree panel to hide the root node RootVisible="false", then they should show the same node hierarchy.

There's no option to show the root node in the tree list component. It is a lightweight alternative to tree panel in which the feature set is intentionally reduced.

Hope this helps!

Vamsi
Oct 21, 2020, 9:20 AM
Thank you for reply. Is there any option to find event when user select expand event(arrow mark) using treelist.

25456

I need to get the data from database and append the nodes like child nodes dynamically based on the node item(selected value).

Is there any approach to get event before expand event or expand event like that.


My requirement is when ever user click on arrow button in treelist then we will get the data from database and append to the treelist instead of preloaded.

Thank you,
Vamsi.

fabricio.murta
Oct 21, 2020, 5:06 PM
Hello Vamsi!


Is there any option to find event...

To find supported events just check intellisense suggestions while writing the <Listeners> block.

To look up documentation for supported events and further details, you can look up the Ext JS framework documentation. For instance, Ext.list.Tree.events documentation (https://docs.sencha.com/extjs/7.2.0/classic/Ext.list.Tree.html#events).


...event when user select expand event(arrow mark) using treelist.

For the specific event you want, I am afraid there is none to the TreeList component. In that case, you ought to switch to the TreePanel component (https://examples5.ext.net/#/TreePanel/Basic/Built_in_Markup/).


My requirement is when ever user click on arrow button in treelist then we will get the data from database and append to the treelist instead of preloaded.

Your requirement is not attainable with the default implementation of the TreeList. This requirement also points towards using the TreePanel to dynamically load nodes on demand (https://examples5.ext.net/#/TreePanel/Loaders/Direct_Method/).

You can, as with any Ext.NET component, extend the TreeList one to support other features like node expand event and also pulling extra nodes from remote.

Hope this helps!

Vamsi
Oct 21, 2020, 5:38 PM
Thank your reply..I don't want to switch to teepanel..is there any option to add the before load event to the treelist..



Thank you,
Vamsi.

fabricio.murta
Oct 21, 2020, 5:47 PM
Hello @vamsi!

There is, extending the component as said in the last message. We unfortunately don't have any work or sample on this already done for the specific TreeList component and BeforeLoad event.

You are free and encouraged to extend any Ext.NET component to your needs. If you are unsure how to extend components we can share some material from Ext JS and there are also other threads here in the forums with samples and questions about it. But if what you wanted was actual working code with the extension already developed, we simply don't have it.

I am reluctant to log this as a feature request as the functionality is already available via the TreePanel and it could compromise the lightweight goal of the TreeList one. So we can't just offer this feature for everyone.

Vamsi
Oct 23, 2020, 4:04 PM
Thanks for the update.

I'm not familiar about extend the treelist and if possible can you please provide the sample code treelist extends before load event on node expand.

Thank you,
Vamsi.

geoffrey.mcgill
Oct 23, 2020, 7:10 PM
Hi. I took a look and we do not have a sample demonstrating this scenario.

If you're looking for extra professional services to help on your project, posting a request in the Jobs forum (https://forums.ext.net/forumdisplay.php?16-Jobs) may help find someone.