mjcramos Posted December 23, 2016 Posted December 23, 2016 Greetings, I'm implementing a unitreeview in an application and would like to customize the colors and some functions, I found here in the forum a topic that almost solved my problem, UniSession.SetStyle( '#' + NavTreeView.JSName + '_id .x-tree-view{'+ ' background-color: ' + uniColor2Web(NavTreeView.Color) + ';'+ '}'+ '#' + NavTreeView.JSName + '_id .x-tree-view .x-grid-cell-inner-treecolumn{'+ ' background-color: ' + uniColor2Web(NavTreeView.Color) + ';'+ ' color: ' + uniColor2Web(NavTreeView.Font.Color) +';'+ ' fontSize:' + uniColor2Web(NavTreeView.Font.Size) +';'+ ' font: ' + NavTreeView.Font.ToString(False, False, False, False) +';'+ '}'+ '#' + NavTreeView.JSName + '_id .x-tree-view Ext.select(ColCells).setStyle("cursor", "pointer");' ); It was very good, but I would like to move the mouse over the cell it changed the color, same as the original, when applying this code it disabled this function, I am sending an image of the original, the color is white and when I move the mouse over The node becomes dark Quote
Sherzod Posted December 23, 2016 Posted December 23, 2016 Hi, Sorry, can you clarify your issue with a little more details,and attach a test case? Best regards. Quote
mjcramos Posted December 23, 2016 Author Posted December 23, 2016 Hello, thanks for the quick reply, it would be kind to hover over the menu and highlight the color of the option that is below the mouse cursor, the normal treeview when passing the mouse does this, however after applying the code of this function it has lost this property I'm using the google translator, sorry for the pronunciation tree.rar Quote
Sherzod Posted December 23, 2016 Posted December 23, 2016 Hi, Try this: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniSession.SetStyle( '#' + UniTreeView1.JSName + '_id .x-tree-view{'+ ' background-color: ' + uniColor2Web(UniTreeView1.Color) + ';'+ '}'+ '#' + UniTreeView1.JSName + '_id .x-tree-view .x-grid-cell-inner-treecolumn{'+ ' background-color: ' + uniColor2Web(UniTreeView1.Color) + ';'+ ' color: ' + uniColor2Web(UniTreeView1.Font.Color) +';'+ ' fontSize:' + uniColor2Web(UniTreeView1.Font.Size) +';'+ ' font: ' + UniTreeView1.Font.ToString(False, False, False, False) +';'+ '}'+ '#' + UniTreeView1.JSName + '_id .x-tree-view .x-grid-row-selected .x-grid-cell-inner-treecolumn {'+ ' background-color: ' + uniColor2Web(clLime) + ';'+ ' color: ' + uniColor2Web(clBlack) +';'+ ' fontSize:' + uniColor2Web(UniTreeView1.Font.Size) +';'+ ' font: ' + UniTreeView1.Font.ToString(False, False, False, False) +';'+ '}' ); end; Best regards. Quote
mjcramos Posted December 23, 2016 Author Posted December 23, 2016 This solved my problem, thank you very much and merry christmas. Quote
skafy Posted February 22, 2023 Posted February 22, 2023 Hi, Code from first post is working, when there is no login form. If login is must be show before main form the treeview present itself as white colored. I attached project. Project2.zip Quote
skafy Posted February 23, 2023 Posted February 23, 2023 Yes this worked. How come I didn't found this. I searched for hours. Thank you! Quote
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.