Hi Ralf

I followed your instructions and overwrite css methods by subclassing 
qx.ui.table.cellrenderer.Abstract and overwriting _getContentHtml method. I 
would like to try to get the same effect by overwriting _getCellClass method. 
My question is: where should I define mySpecialCssClass? Is this a pure css 
file? If so how to include it into the project?

S pozdravem / Best regards,

Monika Falk, Software Specialist
Tieto


Message: 1
Date: Sun, 5 Jul 2009 16:37:08 +0200
From: Ralf Nieuwenhuijsen <[email protected]>
Subject: Re: [qooxdoo-devel] Appearance id in table cell
To: qooxdoo Development <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Here's a stripped down version of what I use to do that:
I subclass qx.ui.table.cellrenderer.Abstract, and overwrite the _getCellClass 
method.
There i add my class mySpecialCssClass which I put in an css file of my own.

You can't use appearances in table-cells. I assume this has to do with 
performance.
But for most needs just a little css class will do thing. And it should perform 
much faster than using:

_getContentHtml: function( cellInfo ){
  return "<span style=' ... my style hacks '>" +  qx.bom.String.escape( 
cellInfo.value ) + "</span>"
}

But that too, would work!
But you need to subclass and make your own cellrendered either way.
You assign the cellrenderer like this;

    var tcm = myTable.getTableColumnModel();
    tcm.setDataCellRenderer( i, new myProject.myCellRenderer() );

Where i would be the column-index...
Here is a full-blown cellrenderer example that just adds a css class.
You can also remove the _getCellClassCSS method and put in the _getContentHtml 
method above to just put style hacks into there directly.

////////////////////////////////////////////
qx.Class.define("myProject.myCellRenderer",{
extend: qx.ui.table.cellrenderer.Abstract,
construct:function(){
////////////////////////////////////////////

  this.base( arguments );

///////////
},members:{
///////////

  _getCellClass:function(cellInfo){
      var cellClass = this.base(arguments, cellInfo);
      if( !cellClass || cellInfo.value == null ) return "";
      return cellClass + " mySpecialCssClass";
   }

////
}});
////


Mvg,
Ralf ( @ gong.nl // 06-49147635 )


2009/7/3 <[email protected]>

>  Hi Everyone
>
> I need to change an appearance in table cell. However I cannot find 
> anywhere the id of the table cell. Any help would be much appreciated.
>
> S pozdravem / Best regards,
>
> *Monika Falk*, Software Specialist
>
> *Tieto*

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to