PDA

View Full Version : Bug TreeStore Ajax XML in IE9?



naxito
2 Nov 2012, 12:37 AM
Hello,
I have a problem with an Ajax XML TreeStore, in IE9.

TreeStore.js line 347 -> data[reader.root] is undefined



delete data[reader.root]



It is working fine in FF and Chrome.
it's easy to solve... just adding a check.

if(data[reader.root]) delete data[reader.root]

But I am not sure if it is a bug , or it is somekind of error in my code.

Here is my code
App.js

Ext.application({
name: 'TreeStoreBug',
appFolder: 'app',
controllers: ['Tree'],
launch: function () {
Ext.create('Ext.container.Viewport', {
layout: 'fit',
items: [{
xtype: 'panel',
items: [{
xtype: 'view_treegrid'
}]
}]
});
}
});
Controller

Ext.define('TreeStoreBug.controller.Tree', {
extend: 'Ext.app.Controller',
views: ['Tree'],
models:['Node'],
stores:['Tree'],
init: function () {
this.control({
'#view_treegrid': {
render: this.onEditorRender
}
})
},
onEditorRender: function () { }
})
View

Ext.define('TreeStoreBug.view.Tree', {
extend: 'Ext.tree.Panel',
id: 'view_treegrid',
alias: 'widget.view_treegrid',
store: 'Tree',
rootVisible: false,
columns: [{ header: 'Id', dataIndex: 'id', flex: 1, xtype: 'treecolumn' }, { header: 'Text', dataIndex: 'text', flex: 1 }]
})
Model

Ext.define('TreeStoreBug.model.Node', {
extend: 'Ext.data.Model',
idProperty: 'id',
fields: [{ name: 'id', mapping: 'id', type: 'string' },
{ name: 'text', mapping: 'text', type: 'string' }
]

});
Store

Ext.define('TreeStoreBug.store.Tree', {
extend: 'Ext.data.TreeStore',
model: 'TreeStoreBug.model.Node',
autoLoad: true,
proxy: {
type:'ajax',
url:'nodes.xml',
reader: {
type: 'xml',
root:'nodes',
record: '> node'
}
},
root: {
expanded: true
},
listeners: {
load: function (store, records, indices, opciones) {
}
}
})
xml


<OpenHR>
<nodes>
<node>
<leaf>0</leaf>
<text>0000581141</text>
<id>000058114100000000</id>
<nodes>
<node>
<leaf>1</leaf>
<text>0581</text>
<id>0581</id>
</node>
</nodes>
</node>
</nodes>
</OpenHR>

And in the following link, it's the test case
http://nasflora.myds.me/TreeStoreBug/index.html

naxito
4 Nov 2012, 11:48 PM
no one knows?

stoertebeker
11 Dec 2012, 8:57 AM
Hi,
honestly I am not quite sure what the issue is. I opened the link in Chrome on Mac and everything seems to work, but I have an app that also has issues on older Vista and XP machines (any browser). Have you tried another proxy type? JSONP?

ok