On Dec 14, 2007 4:13 PM, Kirk Abbott <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> I think that I have found a bug with the setColumns method.
>
> I have code that does the following:
>
>         var table_model = new qx.ui.table.model.Simple();
>         var columns = [""];
>         table_model.setColumns(columns);
>
>         var row_data = [];
>         table_model.setData(row_data);
>
>         /*
>          * Get the data from the database as a side effect table model
> will be updated.          * This does an asynchronous call which is *not
> guaranteed* to finish before
>          * the view creation code is called!!! The true number of
> columns is *not* known
>          * until after this call.
>          */
>         this.get_custom_report_data(queryString, table_model); // (1)
>
>         /* Create the view */
>         var view = new qx.ui.table.Table(table_model); // (2)
>
> The problem is that once the view i.e. qx.ui.table.Table is created,
> attempting to 'reset' the columns does not work by a
> table_model.setColumns(column_data.  This becomes critical when the
> number of columns is not known before hand, but is being pulled back
> asynchronously so that there is no guarantee that (2) will not be
> executed before (1) is complete.
>
> At the moment, my hack is to implement a 'refresh' button that totally
> destroys the table and then recreates it (hopefully after the async call
> is done).
>
> The correct seems to be a combination of:
> a) an event listener that listens to when the async call is complete
> b) to correct the 'bug' in table model so that it will refresh the ui
> when a setColumns call is made
>
> Any ideas?

I spent the past hour working on this "bug" (option b) and decided
that you should go with an event listener (option a).  The whole table
is so tied up in the column structure that it would pretty much
require tearing down the table and rebuilding it to support a dynamic
change of the number of columns.  I've added additional documentation
on the setColumns() method to make this clear.

Derrell

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to