Jump to content

TuniTreeView- set selected node to top of list


1938

Recommended Posts

Is there a way to set the selected node to the top of the treeview list?  Or control where in the list the selected node starts?  I've seen behavior (probably caused by me) where the selected node scrolls off of the screen and I want to push it to the top of the list.

 

-1

Link to comment
Share on other sites

7 minutes ago, 1938 said:

Is there a way to set the selected node to the top of the treeview list?  Or control where in the list the selected node starts?  I've seen behavior (probably caused by me) where the selected node scrolls off of the screen and I want to push it to the top of the list.

Hello,

Sorry, can you please explain in more detail?

If possible, make a simple testcase, by specifying what behavior you want.

Link to comment
Share on other sites

Yes thank you.

A easy to see example is in the Rad Studio IDE.  In the project "Structure" panel you see errors, Types, Procedures Classes etc...  Expand those.  Once a node is expanded that fills the panel with more child nodes than can be displayed, it forces that selected node to the top of the treeview panel.

 

In my case, I am using memtable to fill the treeview.  Some of the node lists are lengthy - maybe 200 or so nodes/child nodes.  I want the expanded/selected node to go to the top of the panel when I click the "plus" to expand a node.

I hope that helps.

 

 

Link to comment
Share on other sites

3 minutes ago, 1938 said:

A easy to see example is in the Rad Studio IDE.  In the project "Structure" panel you see errors, Types, Procedures Classes etc...  Expand those.  Once a node is expanded that fills the panel with more child nodes than can be displayed, it forces that selected node to the top of the treeview panel.

Sorry, can you make and attach here a gif file!?

Link to comment
Share on other sites

In the attached gif's

 

treeview-1 - shows how I want it to behave.  That gif is from the RAD Studio 10.3 IDE.  The selection relocates the selected node at the top.  

treeview-2 is the behavior I am getting.  The treevew  scrolls the seleted node off the screen.  I would like to make user1 at the top when I select it.

 

Thanks for your help.

treeview-1.gif

treeview-2.gif

Link to comment
Share on other sites

17 hours ago, 1938 said:

In the attached gif's

Thanks

17 hours ago, 1938 said:

treeview-1 - shows how I want it to behave.  That gif is from the RAD Studio 10.3 IDE.  The selection relocates the selected node at the top.  

treeview-2 is the behavior I am getting.  The treevew  scrolls the seleted node off the screen.  I would like to make user1 at the top when I select it.

I am analyzing.

Link to comment
Share on other sites

On 7/22/2020 at 10:20 PM, 1938 said:

No, its set to false.  Set to true, I get incomplete redraw of treeview.  Sometimes only the root node.

Hi,

Try to use this approach:

UniTreeView.ClientEvents.ExtEvents ->

function afteritemexpand(node, index, item, eOpts)
{
    node.getOwnerTree().setSelection(node);
    
    item.scrollIntoView(true);
    //or by using Ext.defer
    //Ext.defer(function(){item.scrollIntoView(true)}, 50);
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...