PDA

View Full Version : DynamicXmlReader



ljkmchale
18 Jan 2010, 12:10 PM
Good Day All; I am trying to get this to work but it seems that the this.recordType = Ext.data.Record.create(arr) is no longer working for this code. I am at wits end and would love some help on this. I have been receiving this error "this.ef[j] is not a function".



Ext.data.DynamicXmlReader = function(config) {
Ext.data.DynamicXmlReader.superclass.constructor.call(this, config, []);
};
Ext.extend(Ext.data.DynamicXmlReader, Ext.data.XmlReader, {
getRecordType: function (data) {
recordDefinition = Ext.DomQuery.select(this.meta.recordDefinition + ' > *', data);
var arr = [];
for (var i = 0; i < recordDefinition.length; i++) {
arr[i] = {
name: recordDefinition[i].tagName,
header: recordDefinition[i].getAttribute('header'),
tooltip: recordDefinition[i].getAttribute('tooltip'),
width: recordDefinition[i].getAttribute('width'),
hidden: recordDefinition[i].getAttribute('hidden') == "true" ? true : false
};
}
this.recordType = Ext.data.Record.create(arr);
return this.recordType;
},

readRecords: function (doc) {
this.xmlData = doc;
var root = doc.documentElement || doc;
this.getRecordType(root);
return Ext.data.DynamicXmlReader.superclass.readRecords.call(this, doc);
}
});