Hi Stefan,

thanks a lot for your help.
Now it is clear and it works fine.

So, in the demobrowser you see always the complete class and functions,
but not how they are called?
for example, You cannot see how getCaption is called?

getCaption : function() {
      return "Table using conditional cell renderer";
    },




greetings
Hansjoerg

2010/2/3 Stefan Volbers <volb...@linstep.de>

> Hi Hansjoerg,
>
> you're almost there...:-)
> Look at what you are pasting there, it contains two functions. The first
> isn't relevant here, the second creates a table and returns it.
>
> All you need is the _content_ of the second function, and instead of
> returning 'table', you'd just add it to the application root:
> this.getRoot().add(table);
>
> HTH,
>
> greetings,
> Stefan
>
> PS the conditional table is very interesting stuff, but the magic is in
> qx.ui.table.cellrenderer.Conditional; once read it myself and happily
> used it in a project
>
> On 03.02.2010 13:29, Qoodary wrote:
> >
> > Hi list,
> > I am new to Qooxdoo. I am reading a lot in the docu and now I want to
> play a
> > little bit in the playground to understand the examples better.
> > I tried to fill in the code from Table_Conditional demo.
> >
> >
> http://demo.qooxdoo.org/current/demobrowser/#table~Table_Conditional.html<http://demo.qooxdoo.org/current/demobrowser/#table%7ETable_Conditional.html>
> >
> > I know I cannot copy paste this code for using in playground:
> > -----------------
> >   getCaption : function() {
> >        return "Table using conditional cell renderer";
> >      },
> >
> >
> >      createTable : function()
> >      {
> >        // table model
> >        var tableModel = new qx.ui.table.model.Simple();
> >        tableModel.setColumns([ "ID", "Number 1", "Number 2", "Image" ]);
> >
> >        var image = [
> >         "icon/16/actions/dialog-ok.png",
> >         "icon/16/actions/dialog-cancel.png"
> >        ];
> >
> >        var rowData = [];
> >        for (var row = 0; row<  100; row++) {
> >          var x = Math.random() * 1000;
> >          rowData.push([ row, x, x, image[Math.floor(x) % 2] ]);
> >        }
> >        tableModel.setData(rowData);
> >        tableModel.setColumnEditable(1, true);
> >        tableModel.setColumnEditable(2, true);
> >
> >        // table
> >        var table = new qx.ui.table.Table(tableModel);
> >
> >        table.setMetaColumnCounts([1, -1]);
> >        var selectionMode =
> > qx.ui.table.selection.Model.MULTIPLE_INTERVAL_SELECTION;
> >        table.getSelectionModel().setSelectionMode(selectionMode);
> >
> >        var newRenderer = new
> qx.ui.table.cellrenderer.Conditional("right",
> > "", "", "");
> >        newRenderer.addNumericCondition(">", 0,   null, "#FF0000", null,
> > null);
> >        newRenderer.addNumericCondition(">", 50,  null, "#EE0011", null,
> > null);
> >        newRenderer.addNumericCondition(">", 100, null, "#DD0022", null,
> > null);
> >        newRenderer.addNumericCondition(">", 150, null, "#CC0033", null,
> > null);
> >        newRenderer.addNumericCondition(">", 200, null, "#BB0044", null,
> > null);
> >        newRenderer.addNumericCondition(">", 250, null, "#AA0055", null,
> > null);
> >        newRenderer.addNumericCondition(">", 300, null, "#990066", null,
> > null);
> >        newRenderer.addNumericCondition(">", 350, null, "#880077", null,
> > null);
> >        newRenderer.addNumericCondition(">", 400, null, "#770088", null,
> > null);
> >        newRenderer.addNumericCondition(">", 450, null, "#660099", null,
> > null);
> >        newRenderer.addNumericCondition(">", 500, null, "#5500AA", null,
> > null);
> >        newRenderer.addNumericCondition(">", 550, null, "#4400BB", null,
> > null);
> >        newRenderer.addNumericCondition(">", 600, null, "#3300CC", null,
> > null);
> >        newRenderer.addNumericCondition(">", 650, null, "#2200DD", null,
> > null);
> >        newRenderer.addNumericCondition(">", 700, null, "#1100EE", null,
> > null);
> >        newRenderer.addNumericCondition(">", 750, null, "#0000FF", null,
> > null);
> >        newRenderer.addNumericCondition(">", 800, null, "#0033FF", null,
> > null);
> >        newRenderer.addNumericCondition(">", 850, null, "#0066FF", null,
> > null);
> >        newRenderer.addNumericCondition(">", 900, null, "#0099FF", null,
> > null);
> >        newRenderer.addNumericCondition(">", 950, "center", "#00CCFF",
> null,
> > "bold");
> >        table.getTableColumnModel().setDataCellRenderer(2, newRenderer);
> >
> >        var renderer = new qx.ui.table.cellrenderer.Image(19, 16);
> >        table.getTableColumnModel().setDataCellRenderer(3, renderer);
> >
> >        return table;
> >      }
> >
> > ------------------
> >
> > But how can I do this to play a little bit with conditions, colors and
> > other?
> >
> > best regards
> > Hansjoerg
>
>
> ------------------------------------------------------------------------------
> 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
>
------------------------------------------------------------------------------
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

Reply via email to