1938 Posted July 21, 2020 Share Posted July 21, 2020 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 21, 2020 Share Posted July 21, 2020 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. Quote Link to comment Share on other sites More sharing options...
1938 Posted July 21, 2020 Author Share Posted July 21, 2020 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 21, 2020 Share Posted July 21, 2020 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!? Quote Link to comment Share on other sites More sharing options...
1938 Posted July 21, 2020 Author Share Posted July 21, 2020 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. Quote Link to comment Share on other sites More sharing options...
1938 Posted July 21, 2020 Author Share Posted July 21, 2020 I have tried UniTreeViewFolders.Selected.MakeVisible; But perhaps I don't understand what it is supposed to do or what event needs to contain the code. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 22, 2020 Share Posted July 22, 2020 6 hours ago, 1938 said: UniTreeViewFolders.Selected.MakeVisible; But perhaps I don't understand what it is supposed to do or what event needs to contain the code. LoadOnDemand = True ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 22, 2020 Share Posted July 22, 2020 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. Quote Link to comment Share on other sites More sharing options...
1938 Posted July 22, 2020 Author Share Posted July 22, 2020 No, its set to false. Set to true, I get incomplete redraw of treeview. Sometimes only the root node. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 22, 2020 Share Posted July 22, 2020 Which build are you using? Quote Link to comment Share on other sites More sharing options...
1938 Posted July 23, 2020 Author Share Posted July 23, 2020 On 7/22/2020 at 10:28 AM, Sherzod said: Which build are you using? 1.90.0.1533 Rad Studio 10.2 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 24, 2020 Share Posted July 24, 2020 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); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.