Revision history [back]

click to hide/show revision 1
initial version

answered 2014-03-19 11:31:35 +0800

chillworld gravatar image chillworld flag of Belgium

https://github.com/chillw...

First of all add this to your zul where the tree is in:

<style>   
    .colorEven{ background:Blue};
    .colorOdd{ background:Aqua};
</style>

In your renderer you have this :

public void render(Treeitem treeitem, Object data, int index) throws Exception {
}

put this in your renderer, so just see if index is even or not like this :

if (index%2==0) {
    treeitem.setSclass("colorEven");
} else {
    treeitem.setSclass("colorOdd");
}

Greetz chill.

First of all add this to your zul where the tree is in:

<style>   
    .colorEven{ background:Blue};
background:Blue;}
    .colorOdd{ background:Aqua};
background:Aqua;}
</style>

In your renderer you have this :

public void render(Treeitem treeitem, Object data, int index) throws Exception {
}

put this in your renderer, so just see if index is even or not like this :

if (index%2==0) {
    treeitem.setSclass("colorEven");
} else {
    treeitem.setSclass("colorOdd");
}

Greetz chill.

First of all add this to your zul where the tree is in:

<style>   
    .colorEven{ background:Blue;}
    .colorOdd{ background:Aqua;}
</style>

In your renderer you have this :

public void render(Treeitem treeitem, Object data, int index) throws Exception {
}

put this in your renderer, so just see if index is even or not like this :

if (index%2==0) {
    treeitem.setSclass("colorEven");
treeitem.setStyle("background:red");
} else {
    treeitem.setSclass("colorOdd");
treeitem.setStyle("background:blue");
}

Greetz chill.

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More