0

Changing Selection Colour - List Box (from default blue) to another custom colour

asked 2012-04-26 12:00:53 +0800

vigneshsk gravatar image vigneshsk
27

Hi,
Can anyone help me out to change the selection colour of a listitem in a list box. the code below doesn't work.

<style>
	div.z-listbox.testlistbox tr.z-list-item-seld
, div.z-listbox.testlistbox tr.z-listitem-seld{
	color : #80FF00; 
}
	div.z-listbox.testlistbox .z-list-item div.z-list-cell-cnt
, div.z-listbox.testlistbox .z-listitem div.z-listcell-cnt{
	color : #FF0000; 
}
</style>


I searched the forums nd googled a lot.. Cant find a right solution. Can anyone really solve this?

delete flag offensive retag edit

8 Replies

Sort by ยป oldest newest

answered 2012-04-26 14:01:33 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2625 3 8
http://emrpms.blogspot.in...

Give the full code.

link publish delete flag offensive edit

answered 2012-04-26 14:31:29 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2625 3 8
http://emrpms.blogspot.in...

Try this

<zk>

	<style>


		tr.z-listitem-seld {
		background-image:none ; background-color : #0080C0;}
		

	</style>

	
	<hbox>
		<zscript>
	classes = new String[] { "College", "Graduate" };
	grades = new Object[] { new String[] { "Best", "Better" },
			new String[] { "A++", "A+", "A" } };
</zscript>
		<listbox width="200px" forEach="${classes}">
			<listhead>
				<listheader label="${each}" />
			</listhead>
			<listitem label="${forEachStatus.previous.each}: ${each}"
				forEach="${grades[forEachStatus.index]}" />
		</listbox>
	</hbox>
</zk>

link publish delete flag offensive edit

answered 2012-04-27 06:56:39 +0800

siva477 gravatar image siva477
57

Try this in your CSS file or In your Zul internally by Style Tag.

tr.z-listitem-seld {
background: #80FF00;
}

link publish delete flag offensive edit

answered 2012-04-27 07:12:15 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2625 3 8
http://emrpms.blogspot.in...

Before that, you have to make background image is none

link publish delete flag offensive edit

answered 2012-04-27 08:16:28 +0800

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

i have 5 cent too. :-)

zk5

/* Selected rows in a listbox */
tr.seld,td.seld,tr.z-listitem-seld {
	background: #B8BFDC none repeat scroll 0 0;
}

/* Selected rows with the mouse hovering over them */
tr.overseld,td.overseld,tr.z-listitem-over-seld {
	background: #D3DBFC none repeat scroll 0 0;
}

link publish delete flag offensive edit

answered 2012-04-27 10:52:32 +0800

vigneshsk gravatar image vigneshsk
27

Thank u all. It worked.
Esp. Siva. I tried urs and got it.

Thank u again guys for the help

link publish delete flag offensive edit

answered 2012-04-30 15:12:43 +0800

jhook gravatar image jhook
21 2

I have been fighting with listbox formatting also. I have a multiple select list box with check boxes. I would like the user to check a box and leave the background white. i.e. not use a selected color. I tried siva477's suggestion changing the color to white:

tr.z-listitem-seld {
background: #FFFFFF;
}

This works, but then the text disappears. It appears that the listbox expects the highlighting to a be a contrasting color and then displays the text in an inverse color. If tried adding explicitly setting the color like this but it doesn't work:

tr.z-listitem-seld {
background: #FFFFFF;
color: #000000;
}

I'd appreciate any suggestions.

John

link publish delete flag offensive edit

answered 2012-05-01 04:53:45 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2625 3 8
http://emrpms.blogspot.in...

updated 2012-05-01 04:54:16 +0800

check this

http://emrpms.blogspot.in/2012/04/list-item-with-crud-buttons.html

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: 2012-04-26 12:00:53 +0800

Seen: 571 times

Last updated: May 01 '12

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