MarkLince Posted May 25, 2017 Posted May 25, 2017 Hi, Can anyone tell me how to; 1. Expand all and collapse all nodes in a unidbtreegrid 2. Change selected background color and stop TrackOver 3. Change the default folder icons when showicons is true Thanks Mark Quote
Sherzod Posted May 25, 2017 Posted May 25, 2017 Hi, 1. Expand all and collapse all nodes in a unidbtreegrid You can use like this: UniDBTreeGrid1.JSInterface.JSCall('expandAll', []); UniDBTreeGrid1.JSInterface.JSCall('collapseAll', []); Quote
Sherzod Posted May 25, 2017 Posted May 25, 2017 2. stop TrackOver UniDBTreeGrid -> ... function beforeInit: function beforeInit(sender, config) { config.viewConfig.trackOver=false; } Quote
MarkLince Posted May 25, 2017 Author Posted May 25, 2017 Excellent! thanks Delphi Developer Regards Mark Quote
MarkLince Posted May 25, 2017 Author Posted May 25, 2017 Hi, I swapped the images (folder icons) out in the theme for now, but I'd rather load my own in dynamically without modifying the theme images. Also I'm trying to find what I need to change the selected background color in the sencha reference but am struggling to locate what I need, any help with that would be greatly appreciated. Mark Quote
MarkLince Posted May 25, 2017 Author Posted May 25, 2017 Hi,Also I have noticed that when there is a parent with no child nodes the icon is leaf.png not folder.png which is what I would expect, any ideas about that?ThanksMark Quote
Administrators Farshad Mohajeri Posted May 28, 2017 Administrators Posted May 28, 2017 Hi, Also I have noticed that when there is a parent with no child nodes the icon is leaf.png not folder.png which is what I would expect, any ideas about that? Thanks Mark unidbtree1.png A parent with no child is no longer a parent, it is a leaf. i.e. a node can be called a parent if it has 1 or more children. Quote
Administrators Farshad Mohajeri Posted May 28, 2017 Administrators Posted May 28, 2017 Excellent! thanks Delphi Developer Regards Mark Below methods are already implemented for TreeGrid. procedure FullExpand; procedure FullCollapse; Quote
MarkLince Posted May 29, 2017 Author Posted May 29, 2017 Below methods are already implemented for TreeGrid. procedure FullExpand; procedure FullCollapse; Yes thanks Farshad. I did overlook those methods. Quote
MarkLince Posted May 29, 2017 Author Posted May 29, 2017 A parent with no child is no longer a parent, it is a leaf. i.e. a node can be called a parent if it has 1 or more children. I do get that. I was just thinking of the parent as a "container" and children as "objects" that can be assigned to a container, in that instance a container is still a container even if its empty. Its not a big issue at all. With help, I have all my questions answered now like so; UniSession.SetStyle( ' .x-tree-view { background-color: ' + uniColor2Web(grouptree1.color) + ';'+ '}'+ ' .x-tree-view .x-grid-cell-inner-treecolumn{ background-color: ' + uniColor2Web(grouptree1.color) + ';'+ ' color: ' + uniColor2Web(grouptree1.Font.Color) +';'+ ' fontSize:' + uniColor2Web(grouptree1.Font.Size) +';'+ ' font: ' + grouptree1.Font.ToString(False, False, False, False) +';'+ '}'+ ' .x-tree-view .x-grid-cell-selected .x-grid-cell-inner-treecolumn { background-color: #99cc00;'+ ' color: ' + uniColor2Web(clBlack) +';'+ ' fontSize:' + uniColor2Web(grouptree1.Font.Size) +';'+ ' font: ' + grouptree1.Font.ToString(False, False, False, False) +';'+ '}'+ ' .x-tree-icon { height: 36px; width: 32px;'+ '}'+ '.x-tree-no-lines .x-tree-expander { background-image: url(files/elbow-plus-nl.png);'+ '}'+ '.x-tree-no-lines .x-grid-tree-node-expanded .x-tree-expander {background-image: url(files/elbow-minus-nl.png);'+ '}'+ '.x-tree-icon-leaf { background-image: url(files/leaf.png);'+ '}'+ '.x-tree-icon-parent { background-image: url(files/folder.png);'+ '}'+ '.x-grid-tree-node-expanded .x-tree-icon-parent { background-image: url(files/folder-open.png);'+ '}'+ '.x-grid-row-selected .x-grid-cell { background-color:#99cc00 !important;'+ '}' ); Thanks again Mark Quote
monheim Posted June 19, 2017 Posted June 19, 2017 Dear friends, I try to use CSS that Mark posted above but it doesn't work in my case ( I created Frame, set it's parent as MainForm. If UniDBTreeGrid palced on Form all works fine but if it placed on Frame, it doesn't work. What's wrong? Quote
gerhardhziegler Posted July 19, 2017 Posted July 19, 2017 Dear friends, I try to use CSS that Mark posted above but it doesn't work in my case ( I created Frame, set it's parent as MainForm. If UniDBTreeGrid palced on Form all works fine but if it placed on Frame, it doesn't work. What's wrong? same problem? 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.