Hi Sak.

If a cell is editable, you have to double click it to access the celleditor, 
and then you can manipulate your celleditor (for a textfield editor: 2ble click 
then type; for a checkbox editor: double click then check/uncheck the box).

If you want to toggle a boolean with just one click, you can add a listener on 
your table when a cell is clicked, and change the value in this event.
It would basically look like this:

<code>
var tcm = table.getTableColumnModel();
tcm.setDataCellRenderer(0, new qx.ui.table.cellrenderer.Boolean());

table.addListener("cellClick",
        function(cellEvent) {           
             if (cellEvent.getColumn() == 0) {
                oldValue = table.getTableModel().getValue(0, row);
                table.getTableModel().setValue(0, cellEvent.getRow(), !value); 
                                    }
         });

// Your column won't need to be editable since a simple click will
// "automatically" edit a cell
table.getTableModel().setColumnEditable(0, false);
</code>

Note that no more cell editor is necessary. The cellrenderer will automatically 
graphically represent the value change when you will toggle the boolean inside 
the listener.

HTH.


i...@saksys.de wrote:
> Hi devs,
> 
> want to know how to toggle boolean cells with just one click. I need 3
> clicks to toggle my cell in table.
> 
> My snipplet:
> 
> var tcm = table.getTableColumnModel();
> 
> tcm.setDataCellRenderer(0, new qx.ui.table.cellrenderer.Boolean());
> var propertyCellEditorFactory = new
> qx.ui.table.celleditor.Dynamic(function(){return new
> qx.ui.table.celleditor.CheckBox();});
> tcm.setCellEditorFactory(0, propertyCellEditorFactory);
> 
> regards Sak



-- 
Loïc Bresson


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to