"dataEdited" returns wrong rowIndex when col is sorted

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"dataEdited" returns wrong rowIndex when col is sorted

Marcel Ruff-3
Hi,

I use the

  smart.model.Default

which uses

  qx.ui.table.pane.Scroller

If I edit a column which is sorted the callback event
 "dataEdited"
returns the rowIndex before the Celleditor ends (sorting order of oldValue).

But accessing the data in this callback fails as the model already
has the new sorting.

Like this the edit is assigned to a wrong row, and I have no chance to do proper editing.

Do I miss something or is this a bug?

Here is the offending code from Scroller.js

-----------------------------
// !!!!!This triggers re-sorting
this.getTable().getTableModel().setValue(this.__focusedCol, this.__focusedRow, value);

Thanks
Marcel

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: "dataEdited" returns wrong rowIndex when col is sorted

Alexander Steitz

Hi Marcel,

 

can you the use case you try to solve? If you need to change the sorting somehow you should go for sub-classing an existing model class of the table. The table scroller is all about the view part of the table. This view will get informed by the model if data changed or the e.g. the sorting of the data.

 

So maybe you need to add your custom code at another point of the table widget classes to get your use case solved.

 

Regards,

  Alex

 

From: Marcel Ruff [mailto:[hidden email]]
Sent: Sunday, November 25, 2012 6:02 PM
To: qooxdoo Development
Subject: [qooxdoo-devel] "dataEdited" returns wrong rowIndex when col is sorted

 

Hi,

I use the

  smart.model.Default

which uses

  qx.ui.table.pane.Scroller

If I edit a column which is sorted the callback event
 "dataEdited"
returns the rowIndex before the Celleditor ends (sorting order of oldValue).

But accessing the data in this callback fails as the model already
has the new sorting.

Like this the edit is assigned to a wrong row, and I have no chance to do proper editing.

Do I miss something or is this a bug?

Here is the offending code from Scroller.js

-----------------------------
// !!!!!This triggers re-sorting
this.getTable().getTableModel().setValue(this.__focusedCol, this.__focusedRow, value);

this.__table.focus();

// !!!!!! This event uses the old __focusedRow which point somewhere els

// Fire an event containing the value change.

this.__table.fireDataEvent("dataEdited",

{

row : this.__focusedRow,

col : this.__focusedCol,

oldValue : oldValue,

value : value

});

}
---------------------------

Possible fixes:

1)
this.getTable().getTableModel().setValue()
 could return the correct rowIndex which is than used
 for the dataEdited event

2) Another unique rowIdentifier is returned in the event
 (e.g. the rowData handle) and the rowIndex is set to -1

3) The sorting is delayed after
fireDataEvent()


Thanks
Marcel


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel