Hi,

I have a table, simple model and I'm listening to dataChanged event.
The code looks like this

      var table, model;

      model = new qx.ui.table.model.Simple();
      model.setColumns(
        ["Name", "Type", "Value"],
        ["name", "type", "value"]);
      model.setColumnEditable(2, true);
      model.addListener("dataChanged", this._onDataChanged, this);

      table = new qx.ui.table.Table(model);
      ...

This is not interesting, just for background. Then in _onDataChanged
handler I have this code:

      if (!(e instanceof qx.event.type.Data) || this._syncing) return;

      var data  = e.getData();
      var model = this._table.getTableModel();
      var key   = model.getValue(0, data.firstRow);
      var value = model.getValue(data.firstColumn, data.firstRow);
      ...

And this is the point. Is there a simple way how to get old cell value
when changed? I'm using this way long time, but I'm not sure if
listening for dataChanged event is right approach, because I'm only
interested about changes made by user (and this is always single cell
change).

You can also see complicated stuff to fix cycling events - i'm
updating table cells by this way:

       this._syncing = true;
       model.setValue(data.firstColumn, data.firstRow, value);
       this._syncing = false;

Thanks, I'm mainly interested about getting old cell values, but
comments about cycling events are welcome
- Petr

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to