0

chancge background color of selected row grid

asked 2013-12-01 06:44:47 +0800

RUFUS0863 gravatar image RUFUS0863
1

how change background color of row

thanks

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-12-01 14:54:17 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2013-12-02 07:28:17 +0800

With css:

<zk>
   <style>
       tr.z-listitem-seld { background-image:none; background-color:yellow;}
   </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>

see for yourself here :

http://zkfiddle.org/sample/144129u/1-Change-background-color-selected-item-from-listbox

link publish delete flag offensive edit

Comments

good example... please paste the link to the source of the fiddle next time instead of the temp url to the running example, thanks

cor3000 ( 2013-12-02 03:12:01 +0800 )edit

btw if you don't want to change the colors for all listboxes you can use sclass like this <listbox sclass="mylistbox" ...> and then you can specifically define the color for this listbox only: <style> .mylistbox tr.z-listitem-seld { background-image:none; background-color:yellow;} </style>

cor3000 ( 2013-12-02 03:13:44 +0800 )edit

thx cor, tried to search the real fiddle, didn't find it but created a new one and changed the link here.

chillworld ( 2013-12-02 07:28:58 +0800 )edit

thanks for the fiddle, I added my version with different highlight colors for each listbox http://zkfiddle.org/sample/144129u/2-Change-background-color-selected-item-from-listbox

cor3000 ( 2013-12-02 09:36:01 +0800 )edit
Your answer
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
1 follower

RSS

Stats

Asked: 2013-12-01 06:44:47 +0800

Seen: 96 times

Last updated: Dec 02 '13

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