Jump to content


Photo

UniDBTreeGrid

Unidbtreegrid expandall collapseall

  • Please log in to reply
11 replies to this topic

#1 MarkLince

MarkLince

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 82 posts

Posted 25 May 2017 - 06:56 PM

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


  • 0

Delphi xe7

uniGUI Complete - Professional Edition V1.00 1402


#2 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4754 posts

Posted 25 May 2017 - 07:33 PM

Hi,

 

1. Expand all and collapse all nodes in a unidbtreegrid

 

You can use like this:

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

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

  • 0

#3 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 4754 posts

Posted 25 May 2017 - 07:52 PM

2. stop TrackOver

 

UniDBTreeGrid -> ... function beforeInit:

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

  • 0

#4 MarkLince

MarkLince

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 82 posts

Posted 25 May 2017 - 10:02 PM

Excellent! thanks Delphi Developer

Regards

Mark


  • 0

Delphi xe7

uniGUI Complete - Professional Edition V1.00 1402


#5 MarkLince

MarkLince

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 82 posts

Posted 25 May 2017 - 10:38 PM

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


  • 0

Delphi xe7

uniGUI Complete - Professional Edition V1.00 1402


#6 MarkLince

MarkLince

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 82 posts

Posted 25 May 2017 - 11:14 PM

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

 

Attached File  unidbtree1.png   7.8KB   18 downloads

 

 

 

 


  • 0

Delphi xe7

uniGUI Complete - Professional Edition V1.00 1402


#7 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10245 posts

Posted 28 May 2017 - 04:12 PM

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.


  • 0

#8 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10245 posts

Posted 28 May 2017 - 04:14 PM

Excellent! thanks Delphi Developer

Regards

Mark

 

Below methods are already implemented for TreeGrid.

  procedure FullExpand;
  procedure FullCollapse;

  • 0

#9 MarkLince

MarkLince

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 82 posts

Posted 29 May 2017 - 04:20 PM

 

Below methods are already implemented for TreeGrid.

  procedure FullExpand;
  procedure FullCollapse;

 

Yes thanks Farshad. I did overlook those methods.


  • 0

Delphi xe7

uniGUI Complete - Professional Edition V1.00 1402


#10 MarkLince

MarkLince

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 82 posts

Posted 29 May 2017 - 04:38 PM

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


  • 0

Delphi xe7

uniGUI Complete - Professional Edition V1.00 1402


#11 monheim

monheim

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 19 June 2017 - 09:25 AM

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? 


  • 0

#12 gerhardhziegler

gerhardhziegler

    Member

  • uniGUI Subscriber
  • PipPip
  • 45 posts
  • LocationVienna and Berlin

Posted 19 July 2017 - 01:54 PM

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?


  • 0





Also tagged with one or more of these keywords: Unidbtreegrid, expandall, collapseall

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users