PDA

View Full Version : Error Occurs when attempting to Load Data into an XMLStore in Architect 2 on 4.1.X



bdailey
27 Aug 2012, 2:29 PM
Ext version tested:

Ext 4.1.x
Architect 2

Browser versions tested against:


IE9


Description:
An error occurs when attempting to load data to an XMLStore within Architect 2 on a 4.1.x project. This error does not occur in a 4.0.x project on the exact same xml file.

Steps to reproduce the problem:


Create a Model with the following

Ext.define('MyApp.model.Interval', {
extend: 'Ext.data.Model',

fields: [
{
dateFormat: '',
name: 'Interval_Time',
type: 'string'
},
{
name: 'Request_Volume',
type: 'int'
},
{
name: 'Response_Time',
type: 'int'
},
{
name: 'Percentage_Answered',
type: 'int'
}
]
});


Create a XMLStore, map the model, and attempt to load the following XML structure
<Result>
<Intervals>
<Interval>
<Interval_Time>2012-04-08 12:01:00</Interval_Time>
<Request_Volume>100</Request_Volume>
<Response_Time>5</Response_Time>
<Percentage_Answered>45</Percentage_Answered>
</Interval>
<Interval>
<Interval_Time>2012-04-08 12:02:00</Interval_Time>
<Request_Volume>125</Request_Volume>
<Response_Time>8</Response_Time>
<Percentage_Answered>75</Percentage_Answered>
</Interval>
</Intervals>
</Result>


The result that was expected:


The records should load into the XMLStore as it does with 4.0.X projects.


The result that occurs instead:


An error dialog box displays with the following text -

TypeError: 'undefined' is not an object (evaluating 'b.length') or TypeError: 'undefined' is not an object (evaluating 'a.length')

Source Class: qrc:/designer/src/frameworks/ext41/framework/ext-all.js?0.2914486057125032 Line 18

evant
27 Aug 2012, 2:39 PM
Can't reproduce using Chrome/IE9:



Ext.define('Interval', {
extend: 'Ext.data.Model',

fields: [{
dateFormat: '',
name: 'Interval_Time',
type: 'string'
}, {
name: 'Request_Volume',
type: 'int'
}, {
name: 'Response_Time',
type: 'int'
}, {
name: 'Percentage_Answered',
type: 'int'
}]
});

Ext.require('Ext.data.*');

Ext.onReady(function(){

var store = new Ext.data.Store({
model: Interval,
proxy: {
type: 'ajax',
url: 'data.xml',
reader: {
type: 'xml',
record: 'Interval'
}
}
});
store.on('load', function(){
console.log(store.getCount());
});
store.load();

});


Using your data, it logs 2. Moving to help.

scottmartin
27 Aug 2012, 7:07 PM
Please verify the example provided Evan works on your end. If there still a problem please provide a working example or modify the example to display your problem.

Regards,
Scott.

bdailey
28 Aug 2012, 5:44 AM
As specified in the post heading, this is specific to architect when creating a project in 4.1.X but does not occur in projects 4.0.X -If there is another forum for Architect, please let me know. I've attached two Architect projects - one with 4.0.X which loads the xml file fine and one in 4.1.X which fails with the error I posted in the thread.

Thank you.