PDA

View Full Version : XMLReader



mhubert
31 May 2007, 3:07 PM
var myReader = new Ext.data.XmlReader({
record: "row", // The repeated element which contains record information
totalRecords: "results", // The element which contains the number of returned records (optional)
id: "id" // The element within the record that provides an ID for the record (optional)
}, myRecordDefinition);

is what the Doc states for the API. My issue is w/ the myRecordDefinition. I would like to simply return ALL columns inside the <row>. Which I think would be a sensible default if the parameter was to be leftout or null.

this would also hold true for the JsonReader.

I looked at the ext-all code and think changing the
for(var j = 0, jlen = fields.length; j < jlen; j++){
var f = fields.items[j];

to iterate over the elements in q. would do the trick -- where as doing an extend would be tricky -- but before going down this route -- I wanted to solicit some feedback from the more experianced user community and Jack.

Thanks in advance

Martin
==============================================================
sorry to say -- but after some more code review I need to nix the above idea for a simple code enhancement -- as XmlReader extends DataReader which creates the data.Record based on recordType before the XML ever gets read.
So one would need to have to redo the Ext.data.Record.create(recordType) in the readRecords method.