You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by Joseph Schmidt <jo...@yahoo.com> on 2009/04/18 03:17:05 UTC

Tree display glitches?

Hi,

Is it possible to:
1. get rid of the upper branch from the Root node (when the root is 
displayed?)
2. get rid of the "expand node box" from the Root node when the root is 
expanded or intended to be used always expanded for the first level?

Also is it possible to remove the gray border around the tree?

thanks,
Joseph.


Re: Tree display glitches?

Posted by Bob Schellink <sa...@gmail.com>.
Joseph Schmidt wrote:
>> Not sure we're talking about the same thing here. Do you want to hide 
>> the root expand node, the little + icon? Because I'm referring to the 
>> background vertical line which extends above the root node '+' icon.
> Yes I think we are :).
> And if you add there the CSS class "root" than you can define in the 
> tree.css  this style by having e.g. background-image(empty.png), thus
> hiding that line: since only one background image is allowed, this one 
> will have priority since it's more specific.


Ok will add an extra class for "root". Can you check that it works in 
other browsers and when zooming.

Thanks.

bob



Re: Tree display glitches?

Posted by Joseph Schmidt <jo...@yahoo.com>.
> Not sure we're talking about the same thing here. Do you want to hide 
> the root expand node, the little + icon? Because I'm referring to the 
> background vertical line which extends above the root node '+' icon.
Yes I think we are :).
And if you add there the CSS class "root" than you can define in the 
tree.css  this style by having e.g. background-image(empty.png), thus
hiding that line: since only one background image is allowed, this one 
will have priority since it's more specific.

At least it looks so with FireBug.

thanks,
Joseph.


Re: Tree display glitches?

Posted by Bob Schellink <sa...@gmail.com>.
Not sure we're talking about the same thing here. Do you want to hide 
the root expand node, the little + icon? Because I'm referring to the 
background vertical line which extends above the root node '+' icon.

bob

Re: Tree display glitches?

Posted by Joseph Schmidt <jo...@yahoo.com>.
>> No. I don't want to "handle" it as a label, but at the rest of the tree.
>> That line looks ugly, as the root is connected to nothing (visually).
>>  From a functionality point of view however it's like all other nodes.
>> 1. How can I get rid of this?
>> 2. For other cases, because of usability, I would like to have the 
>> expand box removed (or deactivated), because from the business logic 
>> point of view, all nodes at the first level should be quickly visible, 
>> without the user to click. So is it possible this too?
> 
> 
> Don't think so no. The tree is rendered as an html list and its CSS 
> style and rendering is recursive. So it applies the same style to each 
> node. I did try to get rid of that first line but couldn't get it 
> working in all browsers. If you have a patch for this it would be very 
> welcome.
But the root is known, right? (because of tree.setRootNodeDisplayed(true) )
So why not add another CSS class to that node, called "root"?
This way, that small cell displaying the upper branch/box could be 
rendered with display:none

> Also if you don't care about the visual cue (the vertical lines) then 
> you can probably style the Tree without this problem.
I do. That's the main point of the tree - otherwise I could use a UL/LI
structure myself.

thanks.
Joseph.


Re: Tree display glitches?

Posted by Joseph Schmidt <jo...@yahoo.com>.
> If you have a patch for this it would be very 
> welcome.
In Tree.java:1082
replace:
buffer.appendAttribute("class", "spacer");

with:
if(treeNode.isRoot()){
    buffer.appendAttribute("class", "spacer root"); // or just
    //buffer.appendAttribute("class", "root_spacer");
} else {
    buffer.appendAttribute("class", "spacer");
}

This way the users can use a CSS selector to render something 
differently there in the root.

thanks,
Joseph.


Re: Tree display glitches?

Posted by Joseph Schmidt <jo...@yahoo.com>.
> Btw when writing the Tree I've found at least three ways to create a 
> Tree in html.
> 
> - using html list <ul> elements
> - using a table
> - using divs
> 
> I think it might have been better to use a table instead of html list. 
+1.

However I think that if it's a table, the various interactive 
Sorting/drag&drop + ajax javascript libraries won't be able to work on 
it - they all require UL/LIs :(. If Click Tree would have it's own 
reordering code than it wouldn't be a problem at all.

> This would have allowed the creation of a TreeTable component. :)
+1.
That would be fantastic.
I often need a ?TreeList? (i.e. a TreeTable with only one extra table 
column near the tree node, for e.g. "Actions".

thanks,
Joseph.


Re: Tree display glitches?

Posted by Bob Schellink <sa...@gmail.com>.
Btw when writing the Tree I've found at least three ways to create a 
Tree in html.

- using html list <ul> elements
- using a table
- using divs

I think it might have been better to use a table instead of html list. 
This would have allowed the creation of a TreeTable component. :)

regards

bob

Re: Tree display glitches?

Posted by Bob Schellink <sa...@gmail.com>.
Joseph Schmidt wrote:

> No. I don't want to "handle" it as a label, but at the rest of the tree.
> That line looks ugly, as the root is connected to nothing (visually).
>  From a functionality point of view however it's like all other nodes.
> 1. How can I get rid of this?
> 2. For other cases, because of usability, I would like to have the 
> expand box removed (or deactivated), because from the business logic 
> point of view, all nodes at the first level should be quickly visible, 
> without the user to click. So is it possible this too?


Don't think so no. The tree is rendered as an html list and its CSS 
style and rendering is recursive. So it applies the same style to each 
node. I did try to get rid of that first line but couldn't get it 
working in all browsers. If you have a patch for this it would be very 
welcome.

Also if you don't care about the visual cue (the vertical lines) then 
you can probably style the Tree without this problem.

regards

bob

Re: Tree display glitches?

Posted by Joseph Schmidt <jo...@yahoo.com>.
>> Is it possible to:
>> 1. get rid of the upper branch from the Root node (when the root is 
>> displayed?)
>> 2. get rid of the "expand node box" from the Root node when the root 
>> is expanded or intended to be used always expanded for the first level?
> 
> 
> No, the root node is simply another node of the Tree, its not special in 
> any way.
> 
> It sounds as if you want to handle the root node as a label. In that 
> case why not render the rootNode independently from the Tree or create 
> your own Tree which renders the root node suited to your needs.
No. I don't want to "handle" it as a label, but at the rest of the tree.
That line looks ugly, as the root is connected to nothing (visually).
 From a functionality point of view however it's like all other nodes.
1. How can I get rid of this?
2. For other cases, because of usability, I would like to have the 
expand box removed (or deactivated), because from the business logic 
point of view, all nodes at the first level should be quickly visible, 
without the user to click. So is it possible this too?


>> Also is it possible to remove the gray border around the tree?
> 
> 
> Yes the border is defined in the tree stylesheet. Click places a copy of 
> this stylesheet under /click/tree/tree.css. Grab a copy of that 
> stylesheet and customize as you need.
Wouldn't it be better if the default would be good?
It is not typical for click components to have useless visible borders.

thanks,
Joseph.


Re: Tree display glitches?

Posted by Bob Schellink <sa...@gmail.com>.
Joseph Schmidt wrote:
> 
> Is it possible to:
> 1. get rid of the upper branch from the Root node (when the root is 
> displayed?)
> 2. get rid of the "expand node box" from the Root node when the root is 
> expanded or intended to be used always expanded for the first level?


No, the root node is simply another node of the Tree, its not special 
in any way.

It sounds as if you want to handle the root node as a label. In that 
case why not render the rootNode independently from the Tree or create 
your own Tree which renders the root node suited to your needs.


> Also is it possible to remove the gray border around the tree?


Yes the border is defined in the tree stylesheet. Click places a copy 
of this stylesheet under /click/tree/tree.css. Grab a copy of that 
stylesheet and customize as you need.

regards

bob