0

make rich and easy to view the table made with listbox of ZK component by color

asked 2010-06-10 17:42:10 +0800

stera gravatar image stera
76 6

updated 2010-06-10 22:39:54 +0800

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.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-06-11 02:51:25 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

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");

	}


link publish delete flag offensive edit

answered 2010-06-15 00:54:00 +0800

stera gravatar image stera
76 6

Thank you!

This helped me a lot.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-06-10 17:42:10 +0800

Seen: 238 times

Last updated: Jun 15 '10

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