Jump to content
uniGUI Discussion Forums

Recommended Posts

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

Share this post


Link to post
Share on other sites

Hi,

 

1. Expand all and collapse all nodes in a unidbtreegrid

 

You can use like this:

UniDBTreeGrid1.JSInterface.JSCall('expandAll', []);

UniDBTreeGrid1.JSInterface.JSCall('collapseAll', []);

Share this post


Link to post
Share on other sites

2. stop TrackOver

 

UniDBTreeGrid -> ... function beforeInit:

function beforeInit(sender, config)
{
    config.viewConfig.trackOver=false;
}

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

 

post-4824-0-51697400-1495754036_thumb.png

 

 

 

 

Share this post


Link to post
Share on other sites

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

 

attachicon.gifunidbtree1.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.

Share this post


Link to post
Share on other sites

Excellent! thanks Delphi Developer

Regards

Mark

 

Below methods are already implemented for TreeGrid.

  procedure FullExpand;
  procedure FullCollapse;

Share this post


Link to post
Share on other sites

 

Below methods are already implemented for TreeGrid.

  procedure FullExpand;
  procedure FullCollapse;

 

Yes thanks Farshad. I did overlook those methods.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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? 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×