|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Appearance id in table cellHi 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
email monika.falk@..., direct +420597459905, fax +420597459928
Výstavní 292/13, 70200 Ostrava, Czech Republic, www.tieto.com
Meet the new Tieto: www.tieto.com/newtieto Please note: The information contained in this message may be legally privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified
that any unauthorised use, distribution or copying of this communication is strictly prohibited. If you have received this
------------------------------------------------------------------------------ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Appearance id in table cellHi Monika,
could you please explain, what kind of cell you try to style? I have never tried to style a Table, but I would try to help you. Cheers, Chris monika.falk@... schrieb: > 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* > email monika.falk@..., direct +420597459905, fax +420597459928 > Výstavní 292/13, 70200 Ostrava, Czech Republic, _www.tieto.com_ > > Meet the new Tieto: _www.tieto.com/newtieto_ > Please note: The information contained in this message may be legally > privileged and confidential and protected from disclosure. If the > reader of this message is not the intended recipient, you are hereby > notified that any unauthorised use, distribution or copying of this > communication is strictly prohibited. If you have received this > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > qooxdoo-devel mailing list > qooxdoo-devel@... > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > -- Christian Schmidt Software Entwickler 1&1 Internet AG - Web Technologies Ernst-Frey-Straße 9 · DE-76135 Karlsruhe schmidt.christian@... Amtsgericht Montabaur / HRB 6484 Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver Mauss, Jan Oetjen Aufsichtsratsvorsitzender: Michael Scheeren ------------------------------------------------------------------------------ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Appearance id in table cellHere'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 <monika.falk@...>
------------------------------------------------------------------------------ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
|
|
|
|
|
|
Re: Appearance id in table cellHi Monika,
> > The solution proposed by Ralf Nieuwenhuijsen worked for me pretty well, I just need to clarify few things. > Perfect, that this works for you. If you need any help, pleas ask. Cheers, Chris ------------------------------------------------------------------------------ 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Appearance id in table cellOn Wed, Jul 8, 2009 at 10:33 AM, <monika.falk@...> wrote: In the source directory there is a file called index.html
Here is an example index.html that links to a css file called 'special.css'. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>My Project Title.</title> <link href="special.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="script/pd.js"></script> </head> <body></body> </html> You can also embed css directly into the index.html file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>My Project Title.</title> <STYLE type="text/css"> .mySpecialCssClass { font-weight: 700; font-variant: smallcaps; } .myOtherSpecialCssClass { textColor: #999999; } </STYLE> <script type="text/javascript" src="script/pd.js"></script> </head> <body></body> </html> This last setup at least prevents _another_ server-side request, and should be preferred. Here you see me define a "mySpecialCssClass" (notice the dot in the definition above, it is needed for css-classes) Also, some css-classes that are already defined and usuable in the TabeCellRenderer._getCellClass() are: qooxdoo-table-cell-bold, qooxdoo-table-cell-italic, qooxdoo-table-cell-right You can assign more than one css class to each cell, by adding them to the line separated by spaces. ////////////////////////////////////////////
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 myOtherSpecialCssClass"; } //// }}); //// You can also define your own RowRenderers. It works pretty simelar to cellrenders, except they are applied to the whole row, and get the whole rowdata. I used this to make rows that are 'new' or 'unread' a different color. In reality I don't bother making custom cellrenders for each and every class instead, I put them in my column models. So I have a generic cellrenderer like this; qx.Class.define("oo.table.CellRenderer",{
extend: qx.ui.table.cellrenderer.Abstract, construct:function( vColumn ){ this.base( arguments ); this.setColumnModel( vColumn ); ////////////// },properties:{ ////////////// columnModel:{ check:'oo.model.column.Abstract' } /////////// },members:{ /////////// _getContentHtml:function( cellInfo ){ if( cellInfo.value == null ) return ""; var cm = this.getColumnModel(); return cm.formatHtml( cm.parseValue( cellInfo.value ), cellInfo.rowData ); }, _getCellClass:function(cellInfo){ var cellClass = this.base(arguments, cellInfo); if( !cellClass || cellInfo.value == null ) return ""; return cellClass + " " + this.getColumnModel().getTableCSS(); } //// }}); //// Because I would advise you, if you don't want to go crazy, to have nice models for your database structure. Like having a specific class for each table, and having a specific class for each fieldtype you use. I use the column models (the models of the fieldtypes, like text, string .. date) as factory classes for form-widgets, cellrenders, validation, end-user-formatting, etc. Greetings, Ralf ------------------------------------------------------------------------------ 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
| Free embeddable forum powered by Nabble | Forum Help |