Tobias Koller (GERMO GmbH) schrieb:

Hi,

 

sorry for the flood of mails ;)

I just wanted to add, that I would like to use the celleditor.CheckBox() first and I need an example what to do that the checkbox works fine ;)

Is the celleditor.CheckBox() replacing the cellrenderer.Boolean()?

 

Thanks again ;)

Tobias

 

 

Sorry, I mixed it up. You're right, the renderer of course has no method "createCellEditor" since it is the renderer, not the editor ;-) It should be

var cellInfo = { 'row' : row, 'column': column };

if (this.getTableColumnModel().getDataCellRenderer(column).getCellRendererFactoryFunction()(cellInfo) instanceof qx.ui.table.cellrenderer.Boolean)

{

var value = this.getTableModel().getValue(column, row);

value = !value;

this.getTableModel().setValue(column, row, value);

}

(not tested)

Mind the "getCellRendererFactoryFunction()(cellInfo)". This is not a typo. You retrieve the function and then execute it with the cellInfo object. This should return the REAL cell renderer.

See the documentation comments for the cellRendererFactoryFunction property:

    /**
     * Function that returns a cellRenderer instance which will be
     * used for the row that is currently being edited. The function is
     * defined like this:
     *
     * <pre class="_javascript_">
     * myTable.getTableColumnModel().setCellRenderer(function(cellInfo){
     *   // based on the cellInfo map or other information, return the
     *   // appropriate cell renderer
     *   if (cellInfo.row == 5)
     *     return new qx.ui.table.cellrenderer.Boolean;
     *   else
     *     return new qx.ui.table.cellrenderer.Default;
     * });
     * </pre>
     *
     * the function MUST return at least a qx.ui.table.cellrenderer.Default
     **/

I hope this works now. Sorry for the confusion.

Christian

 

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Im Auftrag von Tobias Koller (GERMO GmbH)
Gesendet: Donnerstag, 11. Oktober 2007 08:21
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] qx.ui.table.cellrenderer.Dynamic

 

Hi,

 

Ok, I’m using the cellrenderer.Dynamic instead of celleditor.Dynamic.

Could someone give me a short code-snippet how to use the celleditor.Dynamic?

Thanks!

 

Tobias

 

 

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Im Auftrag von Tobias Koller (GERMO GmbH)
Gesendet: Donnerstag, 11.
Oktober 2007 07:58
An: [EMAIL PROTECTED]; qooxdoo Development
Betreff: Re: [qooxdoo-devel] qx.ui.table.cellrenderer.Dynamic

 

Hi christian,

Unfortunately  there is no method createCellEditor in widget qx.ui.table.cellrenderer.Dynamic which is this.getTableColumnModel().getDataCellRenderer(column)

what is wrong?

 

Thank you

Tobias

 

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Im Auftrag von bibliograph
Gesendet: Mittwoch, 10.
Oktober 2007 17:31
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] qx.ui.table.cellrenderer.Dynamic

 

Tobias Koller (GERMO GmbH) schrieb:

Hi,

 

i’m playing around with the dynamic cellrenderer.

It works for the usual cellrenderer (default, password,…) but there is a problem when I want to use

a checkbox-renderer inside the dynamic-cellrenderer.

 

Usually I handle checkboxes in a table like this:

 

if (this.getTableColumnModel().getDataCellRenderer(column) instanceof qx.ui.table.cellrenderer.Boolean)

{

var value = this.getTableModel().getValue(column, row);

value = !value;

this.getTableModel().setValue(column, row, value);

}

 

 

But with the new dynamic-cellrenderer this is not possible anymore cause

The datacellrenderer is now dynamic and not Boolean.

 

Is there a way to handle this?

 

 

Hi -

I think this would do the trick:

var cellInfo = { 'row' : row, 'column': column };

if (this.getTableColumnModel().getDataCellRenderer(column).createCellEditor(cellInfo) instanceof qx.ui.table.cellrenderer.Boolean)

{

var value = this.getTableModel().getValue(column, row);

value = !value;

this.getTableModel().setValue(column, row, value);

}


Christian


------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to