View Full Version : prepareData in DataView should not override Record data

22 Mar 2011, 8:35 AM
If you change the data return in the prepareData method in the DataView, it changes the actual data in the Record. This method is used as a renderer method so it should only change the data being sent to the template and not touch the Record.

From API:

Function which can be overridden to provide custom formatting for each Record that is used by this DataView's template to render each node.

15 Jun 2011, 6:56 PM
Bump! just ran into this myself when using your excellent Ext.ux.TouchGridPanel, any progress here? Has it been fixed? Thanks!

PS: Yesterday opened the issue https://github.com/mitchellsimoens/Ext.ux.TouchGridPanel/issues/1 thinking it was a bug in your component and not in sencha, should I close it there and refer to this bug?

21 Jun 2011, 5:14 PM

2 Jul 2011, 7:46 PM
Any update about this bug? It's pretty bad that customizing the output of a DataView changes the record.

3 Jul 2011, 7:22 AM
May not get fixed till ST 2.0

5 Jul 2011, 5:05 PM
As this bug was critical to my company we ended up spending some x-credits to get a fix for this one.

Ext.override(Ext.DataView, {
collectData : function(records, startIndex){
var r = [],
i = 0,
len = records.length;

for(; i < len; i++){
r[r.length] = this.prepareData(Ext.apply({}, records[i].data), startIndex + i, records[i]);

return r;

7 Nov 2011, 2:21 AM
Are there alredy any solution to this bug??
Anybody know how fix it??

I know this bug don't exist in sencha touch version 2.0 as this method don't exist, but I would be interested in solving it because I follow using the previous version of the framework.