myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrique Medina <e.medin...@gmail.com>
Subject Re: Rows highlighting
Date Thu, 11 Aug 2005 14:15:26 GMT
Ups, from when? I usually read all the posts here in a dayly basis and don't 
remember it, but nice!

I'll download the nightly build right now :-)

2005/8/11, Sean Schofield <sean.schofield@gmail.com>:
> 
> t:dataTable already allows row highlighting. See the simple examples
> in the latest nightly.
> 
> sean
> 
> 
> On 8/11/05, Enrique Medina <e.medina.m@gmail.com> wrote:
> > Hi,
> >
> > Just a simple workaround until DataTable allows to do row highlighting:
> >
> > <htm:style type="text/css">
> > <x:outputText
> > value="<!--
> > .tbl {
> > width: 100%;
> > border-collapse: collapse;
> > }
> > .tbl td {
> > text-align: center;
> > }
> > .tbl th {
> > text-align: left;
> > background-color: #ebeadb;
> > height: 20px;
> > }
> > .tbl .on {
> > background-color: #faf9f4;
> > }
> > .tbl .off {
> > background-color: #fff;
> > }
> > .tbl .hover {
> > background-color: #ffb164;
> > }
> > -->" />
> > </htm:style>
> >
> > <htm:script>
> > <x:outputText
> > value="
> > <!--
> > var elem = 'TR';
> >
> > window.onload = function(){
> > if(document.getElementsByTagName){
> > var el = document.getElementsByTagName(elem);
> > for(var i=0; i<el.length;
> > i++){
> > if(el[i].childNodes[0].tagName !='TH'
> > &&
> > el[i].parentNode.parentNode.className.indexOf('tbl') !=-1){
> > if(i%2 == 1){
> > el[i].className='on'
> > ;
> > el[i].onmouseout=function(){ this.className='on'
> > ;
> > }
> > } else {
> > el[i].className='off'
> > ;
> > el[i].onmouseout=function(){ this.className='off'
> > ;
> > }
> > }
> > el[i].onmouseover=function(){
> > this.className='hover';
> > }
> > }
> > }
> > }
> > }
> > //-->" />
> >
> > </htm:script>
> >
> > Please note that I'm using the htmLib tag library ;-)
> >
> > Then, simply add to your <x:dataTable> the attribute styleClass="tbl", 
> and
> > it works like a charm!
> >
> >
>

Mime
View raw message