Hi Derrell, thanks a lot for this example. It works fine!
It seems easy if you know how to do :-) best regards Hansjoerg Derrell Lipman wrote: > > On Fri, Feb 5, 2010 at 03:55, Qoodary <qood...@googlemail.com> wrote: > >> >> Hi Derrell, >> >> I have a question to your playground example. >> As I understand, the cellrenderer checks the value for the column AFTER >> all >> rows are build. >> <<tcm.setDataCellRenderer(1, new custom.MyCellRenderer()); >> >> How can you do it, if you do not want to show any value in the >> corresponding >> column? >> Example: >> My table is build via PHP request. The data comes from a MySQL DB. >> The first column is "State" which should show only a different color >> without >> an value. >> For this column, I can receive from the request either the color value >> (in >> hex) or an ID. >> But I do not want to show the ID or color value in the column, only the >> background-color. >> >> How can you do this? >> > > You mean like this? > > http://demo.qooxdoo.org/devel/playground/#%7B%22code%22%3A%20%22qx.Class.define%28%2522custom.MyCellRenderer%2522%252C%250A%257B%250A%2520%2520extend%2520%253A%2520qx.ui.table.cellrenderer.Default%252C%250A%2520%2520%250A%2520%2520members%2520%253A%250A%2520%2520%257B%250A%2520%2520%2520%2520_getCellStyle%2520%253A%2520function%28cellInfo%29%250A%2520%2520%2520%2520%257B%250A%2520%2520%2520%2520%2520%2520var%2520color%2520%253D%2520cellInfo.value%253B%250A%2520%2520%2520%2520%2520%2520return%2520this.base%28arguments%252C%2520cellInfo%29%2520%252B%2520%2522background-color%253A%2522%2520%252B%2520color%2520%252B%2520%2522%253B%2522%253B%250A%2520%2520%2520%2520%257D%252C%250A%2520%2520%2520%2520%250A%2520%2520%2520%2520_getContentHtml%2520%253A%2520function%28cellInfo%29%250A%2520%2520%2520%2520%257B%250A%2520%2520%2520%2520%2520%2520return%2520%2522%2522%253B%250A%2520%2520%2520%2520%257D%250A%2520%2520%257D%250A%257D%29%253B%250A%250Afunction%2520createRandomRows%28rowCount%29%2520%257B%250A%2520%2520var%2520rowData%2520%253D%2520%255B%255D%253B%250A%2520%2520var%2520now%2520%253D%2520new%2520Date%28%29.getTime%28%29%253B%250A%2520%2520var%2520dateRange%2520%253D%2520400%2520*%252024%2520*%252060%2520*%252060%2520*%25201000%253B%2520%252F%252F%2520400%2520days%250A%2520%2520var%2520nextId%2520%253D%25200%253B%250A%2520%2520for%2520%28var%2520row%2520%253D%25200%253B%2520row%2520%253C%2520rowCount%253B%2520row%252B%252B%29%2520%257B%250A%2520%2520%2520%2520var%2520date%2520%253D%2520new%2520Date%28now%2520%252B%2520Math.random%28%29%2520*%2520dateRange%2520-%2520dateRange%2520%252F%25202%29%253B%250A%2520%2520%2520%2520rowData.push%28%255B%2520nextId%252B%252B%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520row%2520%2525%25202%2520%253D%253D%25201%2520%253F%2520%2522cyan%2522%2520%253A%2520%2522white%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520date%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%28Math.random%28%29%2520%253E%25200.5%29%2520%255D%29%253B%250A%2520%2520%257D%250A%2520%2520return%2520rowData%253B%250A%257D%250A%250A%250A%252F%252F%2520window%250Avar%2520win%2520%253D%2520new%2520qx.ui.window.Window%28%2522Table%2522%29.set%28%257B%250A%2520%2520layout%2520%253A%2520new%2520qx.ui.layout.Grow%28%29%252C%250A%2520%2520allowClose%253A%2520false%252C%250A%2520%2520allowMinimize%253A%2520false%252C%250A%2520%2520contentPadding%253A%25200%250A%257D%29%253B%250Athis.getRoot%28%29.add%28win%29%253B%250Awin.moveTo%2830%252C%252040%29%253B%250Awin.open%28%29%253B%250A%250A%252F%252F%2520table%2520model%250Avar%2520tableModel%2520%253D%2520new%2520qx.ui.table.model.Simple%28%29%253B%250AtableModel.setColumns%28%255B%2520%2522ID%2522%252C%2520%2522A%2520color%2522%252C%2520%2522A%2520date%2522%252C%2520%2522Boolean%2522%2520%255D%29%253B%250AtableModel.setData%28createRandomRows%281000%29%29%253B%250A%250A%252F%252F%2520make%2520second%2520column%2520editable%250AtableModel.setColumnEditable%281%252C%2520true%29%253B%250A%250A%252F%252F%2520table%250Avar%2520table%2520%253D%2520new%2520qx.ui.table.Table%28tableModel%29.set%28%257B%250A%2520%2520decorator%253A%2520null%250A%257D%29%250Awin.add%28table%29%253B%250A%250Avar%2520tcm%2520%253D%2520table.getTableColumnModel%28%29%253B%250A%250A%252F%252F%2520Display%2520a%2520checkbox%2520in%2520column%25203%250Atcm.setDataCellRenderer%283%252C%2520new%2520qx.ui.table.cellrenderer.Boolean%28%29%29%253B%250A%250A%252F%252F%2520Use%2520the%2520custom%2520cell%2520renderer%2520for%2520column%25201%250Atcm.setDataCellRenderer%281%252C%2520new%2520custom.MyCellRenderer%28%29%29%253B%250A%250A%252F%252F%2520use%2520a%2520different%2520header%2520renderer%250Atcm.setHeaderCellRenderer%282%252C%2520new%2520qx.ui.table.headerrenderer.Icon%28%2522icon%252F16%252Fapps%252Foffice-calendar.png%2522%252C%2520%2522A%2520date%2522%29%29%253B%250A%22%7D > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > qooxdoo-devel mailing list > qooxdoo-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > -- View this message in context: http://old.nabble.com/Different-background-color-in-column-cell-of-qx.ui.table.Table-tp27449521p27469123.html Sent from the qooxdoo-devel mailing list archive at Nabble.com. ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel