Tree List -Display the root as same Treepanel

  1. #1

    Tree List -Display the root as same Treepanel

    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.


    Click image for larger version. 

Name:	Tree.png 
Views:	71 
Size:	5.1 KB 
ID:	25453

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


    Thank you,
    Vamsi,
  2. #2
    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!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thank you for reply. Is there any option to find event when user select expand event(arrow mark) using treelist.

    Click image for larger version. 

Name:	TreeList.png 
Views:	77 
Size:	9.8 KB 
ID:	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.
  4. #4
    Hello Vamsi!

    Quote Originally Posted by 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.

    Quote Originally Posted by Vamsi
    ...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.

    Quote Originally Posted by Vamsi
    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.

    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!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    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.
  6. #6
    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.
    Fabrício Murta
    Developer & Support Expert
  7. #7
    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.
  8. #8
    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 may help find someone.
    Geoffrey McGill
    Founder

Similar Threads

  1. Expand root node in the tree panel automatically
    By velusoft in forum 2.x Help
    Replies: 5
    Last Post: Mar 15, 2016, 2:11 AM
  2. TreePanel without Root node
    By Dominik in forum 1.x Help
    Replies: 3
    Last Post: Jun 25, 2014, 7:07 PM
  3. [OPEN] [#349] how to auto expand the tree's root node?
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Nov 18, 2013, 6:26 AM
  4. [CLOSED] TreePanel root
    By cwolcott in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 12, 2012, 1:05 PM
  5. [CLOSED] TreePanel + Root
    By aisi_it_admin in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 08, 2012, 10:34 AM

Posting Permissions