Opened 11 years ago

Closed 5 years ago

#8545 closed defect (wontfix)

Tree: unwanted grid lines with showRoot=false when root's children are leaf nodes (tundra, soria, nihilo)

Reported by: Les Owned by:
Priority: low Milestone: future
Component: Dijit Version: 1.2.3
Keywords: Tree Cc:
Blocked By: Blocking:

Description (last modified by bill)

Grid lines are strange when the root node of the tree is hidden, and the children of that root node are leaf nodes:

Here's a code fragment that demonstrates the issue. I think the tree would look better if none of its nodes contained the expandoNode, which I think is useless in this particular case. I'd like this tree to resemble a list. This would be possible if the tree icons were not prefixed with the expando node.

var data = { identifier: 'name', label: 'name', items: [{ name:'name 1'}, { name:'name 2' }, { name:'name 3' } ]};			
var store = new dojo.data.ItemFileWriteStore({data: data});
var model = new dijit.tree.ForestStoreModel({store: store});
new dijit.Tree({id: "tree", model: model, showRoot: false, }, 'container');

Attachments (1)

tree.png (4.8 KB) - added by bill 11 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 11 years ago by Adam Peller

Component: GeneralDijit
Owner: anonymous deleted

comment:2 Changed 11 years ago by bill

Huh? If there's no expandoNode then you can't open and close nodes. There would be no way to see the children.

And also I don't see any connection to ForestStoreModel. Tree functions the same way regardless of what the model is.

comment:3 Changed 11 years ago by Les

ok... I got a better example and a better explanation, see the code below and the attached image. The circled image to the left of the 2nd icon that looks like dots... what is the purpose of this image? I think this image is useless. This node (and the one below) have no children. If the data has no children and I use the ForestStoreModel?, I should see only tree icons w/o any image to the left of the icons.

Also, have you considered adding a ListStoreModel?? This model would be used for forests that have no children.

var data = { identifier: 'name', label: 'name', items: [{ name:'name 1', children:[{name: 'child 1'}]}, { name:'name 2' }, { name:'name 3' } ]};			
var store = new dojo.data.ItemFileWriteStore({data: data});
var model = new dijit.tree.ForestStoreModel({store: store});
new dijit.Tree({id: "tree", model: model, showRoot: false, }, 'container');

comment:4 Changed 11 years ago by bill

Oh.... ok you are talking about (what we call) "grid lines".

You can hide the grid lines if you want by just making CSS rules that override the rules in tundra, or whatever theme you are using. The pertinent rules in tundra are:

.tundra .dijitTreeNode {
    background-image : url('images/i.gif');
    ...
}

/* left vertical line (grid) for all nodes */
.tundra .dijitTreeIsLast {
    background: url('images/i_half.gif') no-repeat;
    ...

.tundra .dijitTreeExpandoLeaf {
       background-image:url(images/treeExpand_leaf.gif);
}

I think the reason it looks weird on your example is that "name2" and "name3" have no children, and even mayHaveChildren() returns false for them, so instead of getting a plus/minus icon they get nothing.

It should look like the third example in http://docs.dojocampus.org/dijit/Tree

comment:5 Changed 11 years ago by bill

Description: modified (diff)
Summary: Tree: presentation issue using ForestStoreModelTree: presentation issue with showRoot=false when root's children are leaf nodes.

Updating ticket summary to reflect apparent real issue, and replacing screenshot with smaller file.

Changed 11 years ago by bill

Attachment: tree.png added

comment:6 Changed 11 years ago by bill

Milestone: tbdfuture

comment:7 Changed 7 years ago by bill

Priority: highlow
Summary: Tree: presentation issue with showRoot=false when root's children are leaf nodes.Tree: unwanted grid lines with showRoot=false when root's children are leaf nodes (tundra, soria, nihilo)

Claro is unaffected since it doesn't have grid lines. And if I ever get around to rewriting the legacy themes as variations of claro, then I guess they won't have grid lines either.

comment:8 Changed 5 years ago by bill

Resolution: wontfix
Status: newclosed

Closing this since the other themes are deprecated.

Note: See TracTickets for help on using tickets.