0

I coded a CustomTreegrid, and some custom leafs have triple the height of a standard Treenode /leaf. (here is how i did it: custom treenode smartgwt)

But when I want to show connector lines between the nodes with setShowConnectors(true);, the connector lines are only as long as the standard height of a standard TreeNode.

Whenever a custom leaf appears in the tree, there are huge gaps and the connector lines are only as long as the standard height of a leaf.

I've been looking for days for a way to fix it and i looked in skin_styles.css, the functions setConnectorImage(String connectorImage), getConnectorImage. I think the problem is, that the image 'connector_ancestor.gif' is only as high as one leaf and doesn't get drawn multiply times..

How can I fix the gaps in my connector lines?

Edit: Here is an image to show what I mean: (since i can't upload images here yet, its a link to imgur.com) https://i.stack.imgur.com/Ujrzl.jpg

2.Edit searching the api for a solution I came across this sentence in the description of setConnectorImage(String connectorImage) : Connector icons are rendered into the title field of each row and show the dotted hierarchy lines between siblings of the same parent node
-- So it seams I have to play around with the height of the title field, or at least search further in this direction.

Community
  • 1
  • 1
Any1
  • 182
  • 2
  • 15
  • Whenever you're facing an issue related to design, it's always better to attach snapshots describing the same for easy understanding. – RAS Nov 08 '12 at 06:15
  • you're right I've uploaded an image – Any1 Nov 08 '12 at 08:19

2 Answers2

0

After searching for some time, I came to know that the connectors are nothing but a combination of images named as connector.gif. There are so many files combined under this name such as connector_ancestor.gif, connector_closed_end.gif, connector_closed_single.gif etc.

Now I know this is not a good idea, but you can resize these files as per your requirement and I think it should solve your problem.

But again, even I don't find this solution perfect. So let's look forward to some better answer.

RAS
  • 8,100
  • 16
  • 64
  • 86
  • Funny, I just looked at these images too and I'm going to try this out now! thx – Any1 Nov 08 '12 at 11:24
  • I tried out your suggestion and changed the height of the .gif files, but they get always resized to the height of 22px , which is exactly the height of a normal "one row" `TreeNode`! Maybe there is some way to make the name of the node 3 rows long and then the connector gets drawn also longer, but I have no clue how to do that. – Any1 Nov 08 '12 at 12:52
  • I tried further to set the height of a Node with `setRecordComponentHeight(Integer recordComponentHeight)` - the record size gets changed, but the connector lines are still the same. – Any1 Nov 08 '12 at 14:41
  • That's really bad. I hope you could figure out some way to enlarge the image. I'll also try & will let you know if I find something. – RAS Nov 09 '12 at 06:03
  • I haven't been busy on this issue the last days, because i had a lot of other stuff to do..But still I really want to know how to draw these connector lines. I also wrote In the smartclient forum, but did't get a reply. did you find more information? – Any1 Nov 20 '12 at 10:18
  • No I couldn't find any other solution. Can you give me smartclient's link to your post? – RAS Nov 20 '12 at 10:33
  • here you go: http://forums.smartclient.com/showthread.php?t=24343&highlight=treeTallCell – Any1 Nov 20 '12 at 12:36
0

Did you try to play with setShowFullConnectors(Boolean showFullConnectors) I don't know if it will work with multiple rows records but it's worth to test...

Alain BUFERNE
  • 2,016
  • 3
  • 26
  • 37
  • i tried with no success, but maybe i tried not hard enough.. i will have a second look at it later! thx – Any1 Nov 08 '12 at 16:46