SergioFeitoza Posted May 10, 2020 Share Posted May 10, 2020 Please help me with the following. In my code I have a Tunitreeview as in the figure attached I need that the blue button that you see in the right side of the selected node / subnode is positioned at the same “top” dimension of the selected subnode In VCL this can be done using TreeView.SelectedNode.Bounds.Y (for Y position) as in this post https://stackoverflow.com/questions/13068419/grab-the-location-of-selected-node-of-treeview My problem is that I could not find a Unigui property corresponding to “Bounds.X” or “Bounds.Y” Could suggest me a way of doing this ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 10, 2020 Share Posted May 10, 2020 Will you consider scrolling?! Quote Link to comment Share on other sites More sharing options...
SergioFeitoza Posted May 11, 2020 Author Share Posted May 11, 2020 Hi Sherzod. The idea is interesting but I do not know how could I implement. Is there something like this in the demos ? The reason for the need of putting the button - to call the attention for the clicked subnode - is that i I will include a text in the button (like a Hint) Is there something like the "bounds.X" in Unigui ? P.S: Is there any demo with something like draging a component from a position to other, using the mouse ? or how to write the coordinates of the position of a point in the screen? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 11, 2020 Share Posted May 11, 2020 9 minutes ago, SergioFeitoza said: The idea is interesting but I do not know how could I implement. Is there something like this in the demos ? The reason for the need of putting the button - to call the attention for the clicked subnode - is that i I will include a text in the button (like a Hint) Is there something like the "bounds.X" in Unigui ? P.S: Is there any demo with something like draging a component from a position to other, using the mouse ? or how to write the coordinates of the position of a point in the screen? Hi, For example, without considering scrolling: UniTreeView.ClientEvents.ExtEvents -> function select(sender, record, index, eOpts) { var grid=this.ownerGrid; var gridY=grid.getY(); var elem=grid.getEl().select('table[data-recordindex="'+ record.id +'"]').elements[0]; if (elem) { MainForm.UniButton3.setPosition( 150, Ext.get(elem).getY()-gridY+5 ) } } Quote Link to comment Share on other sites More sharing options...
SergioFeitoza Posted May 11, 2020 Author Share Posted May 11, 2020 Thanks Sherzod. Great . I understood and with this I think I can advance 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.