View Full Version : [OPEN] [FIXED-235][3.0.1] XmlReader record lost node property

6 Sep 2009, 11:10 PM
In Ext 1.x, 2.x and 3.0.0 the XmlReader added a node property to each record containing the XML node that was used to extract the data.

In Ext 3.0.1 and up this feature was removed. To keep backward compatibility I recommend adding:

Ext.override(Ext.data.XmlReader, {
extractData : function(root, returnRecords) {
var Record = this.recordType,
records = [],
f = Record.prototype.fields,
fi = f.items,
fl = f.length;
if (returnRecords === true) {
for (var i = 0, len = root.length; i < len; i++) {
var data = root[i];
var record = new Record(this.extractValues(data, fi, fl), this.getId(data));
record.node = data;
} else {
for (var i = 0, len = root.length; i < len; i++) {
var data = this.extractValues(root[i], fi, fl);
data[this.meta.idProperty] = this.getId(data);
return records;

6 Sep 2009, 11:34 PM
Good idea, maybe JsonReader should also insert into the Record a reference to the row object from which the data was extracted. ArrayReader too. Then all renderers would be able to see all the raw data.

6 Sep 2009, 11:36 PM
Ext already does that! Both JsonReader and ArrayReader store the raw object as 'json' property in the record.

(and this has been the case since Ext 1.0 I might add)

7 Sep 2009, 1:54 AM
Yes, I see now I look at the code. I'll wait until the node property is reimplemented and add some helpful documentation about this useful feature.

10 Sep 2009, 3:01 AM
Fix applied to svn in rev #5317 for patch release 3.0.2.