-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello I'm stera.
I want to make rich and easy to view the table made with listbox of ZK component by color.
I want to satisfy clients'damand.
The client is demanding that "The table (made with listbox)is made easy to see by the classification by color".
The column is classified differently respectively.
It is classified by another classification according to the value of each row buried under each cell.
Such as:
___________Column1___________column2____________column3
row1_______district1____________party1_____________ NHK
_____________red_____________lite pink____________dark yellow
row2_______district2____________party2______________TBS
_____________blue____________lite blue____________dark brown
row3_______districk3____________party3______________FUJI
_____________green__________lite green____________dark blue
How to realise this demand on ZK?
What I want to know is that how to attach style or sclass to CELL of table made with listbox bound to collection according to the content or value of data.
If you work with an ItemRenderer than it's easy:
@Override public void render(Listitem item, Object data) throws Exception { SecLoginlog log = (SecLoginlog) data; lc = new Listcell(log.getLglLoginname()); if (log.getLglStatusid() == 0) { lc.setStyle("color:red; text-align: right"); } lc.setParent(item); lc = new Listcell(log.getStpTypname()); if (log.getLglStatusid() == 1) { lc.setStyle("color:green"); } lc.setParent(item); lc = new Listcell(truncateIPForPrivacy(log.getLglIp())); if (log.getLglStatusid() == 2) { lc.setStyle("color:blue"); } lc.setParent(item); item.setAttribute("data", data); // ComponentsCtrl.applyForward(img, "onClick=onImageClicked"); // ComponentsCtrl.applyForward(item, "onClick=onClicked"); // ComponentsCtrl.applyForward(item, "onDoubleClick=onDoubleClicked"); }
Asked: 2010-06-10 17:42:10 +0800
Seen: 238 times
Last updated: Jun 15 '10