Tree control style: line spacing
Is there a way to increase the spacing between the line items in a tree?
I tried to change font size but it didn't change line height and spacing. Tried to set height in css, no effect.
Thanks.
dev2eat
November 22,
try this
for (var r = 1; r < obj.getViewIndices(0).length + 1; r ++ ) {
for (var t = 0; t < obj.getViewIndices(r).length; t ++ ) {
obj.getItemTemplate([obj.getViewIndices(r)[t]]).setStyle('height', 20);
}
}
November 22,
if the above code did't work please let me know
Thimi Jose
November 22,
Thanks Thimi.
I tried it but got "obj.getViewIndices(...).length is null or not an object" error. Looks like an issue with indexing of my tree. Here is my tree structure if it helps(it's two-level deep and item 4 doesn't have child items):
var tree = {
0: [1, 2, 3, 4],
1: [5, 6, 7],
2: [8,9,10,11],
3: [13, 14],
7: [15,16],
11:[17, 18]
}
November 22,
Hello,
Try this :
var tree = {
0: [1,2,3,4],
1: [5,6,7],
2: [8,9,10,11],
3: [12,13],
4: [14],
7: [15,16],
11:[17,18]
}
var obj = new AW.UI.Tree;
obj.setItemText(["","1","2","3","4","1.1","1.2","1.3","2.1","2.2","2.3","2.4","3.1","3.2","","1.3.1","1.3.2","2.4.1","2.4.2"]);
for (var r = 1; r < obj.getViewIndices(0).length + 1; r ++ ) {
for (var t = 0; t < obj.getViewIndices(r).length; t ++ ) {
obj.getItemTemplate([obj.getViewIndices(4)[t]]).setContent("box/sign", ''); // to remove the Box .
obj.getItemTemplate([obj.getViewIndices(r)[t]]).setStyle('height', 40);
}
}
You can even remove the '+' sign of the 4'th , try yourself ...if u r not able to get it, please let me know
Thanks,
Thimi Jose
November 23,
this got cut in the previous post.
var obj = new AW.UI.Tree;
obj.setItemText(["","1","2","3","4","1.1","1.2","1.3",
"2.1","2.2","2.3",
"2.4","3.1","3.2","","1.3.1",
"1.3.2","2.4.1","2.4.2"]);
Thimi Jose
November 23,
You can change the height of the tree (or list) item with CSS -
#myTree .aw-item-template {
height: 30px;
}
Alex (ActiveWidgets)
November 23,
Thanks Alex. That's what I was looking for and it worked.
Thimi, thanks for your help too. Alex's solution will do it for me.
November 25,