On Fri, Mar 20, 2009 at 6:59 AM, Gereon A. Frey <[email protected]> wrote:

> Hi,
>
> I searched for a simple possibility to change the header of one column
> of a TreeVirtuals (aka tables). I found the methods for columns in the
> model (qx.ui.table.model.Abstract) but the API is very strange in my
> eyes.
>
> There is this a method called getColumnName which is given an index and
> returns the appropriate name. I'd expect there to be a method like
> setColumnName given an index and the new name, but there is nothing like
> this. Instead there is for example a method setColumnNamesByIndex which
> just overwrites the old column names with the given new ones. This just
> feels uncomfortable. Is this for historical reasons or did I miss
> something essential?
>

You're right, it is a bit strange. It's uncommon, I think, though, to change
a single column heading (or even to change any column headings at all), so
this issue hasn't been raised before, and there is no method for simply
changing a single column heading.

If you're not providing your own column ids (which I wouldn't expect you to
be doing if this is for a TreeVirtual) then you should be able to simply
pass the entire (modified) array of column headings:

  dataModel.setColumns(columnNameArr);

That columnNameArr is just like you provided as the first parameter to the
constructor of your TreeVirtual. If you're planning on doing these changes
regularly, you might want to save that columnNameArr as user data associated
with the TreeVirtual:

  var tree = new qx.ui.treevirtual.TreeVirtual(columnNameArr);
  tree.setUserData("headings", columnNameArr);

and then later, you can easily retrieve the column names:

  var columnNameArr = tree.getUserData("headings");

Hope that helps.

Derrell
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to