PDA

View Full Version : TreeStore Proxy doesn't see URL config



Mubin
23 Feb 2014, 3:41 AM
Hi

Maybe someone face such problem:

I have TreeStore:

Ext.define('CCH3.store.ClassifyTree', {
extend: 'Ext.data.TreeStore',


model: 'CCH3.model.ClassifyTreeModel',
config: {
root: {
name: 'Tree',
expanded: true
},
storeId:"ClassifyTree",


proxy: {
type:'ajax',
url:'classifyTree.xml',
idProperty:'Id',
reader: {
type:'xml',
record:'classifyNode',
root:'data'


}
}




}
});

Model:

Ext.define('CCH3.model.ClassifyTreeModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{ name: 'Id', type: 'int' },
{ name: 'Caption', type: 'string' }
]


}
});

and want use them in treepanel:


{
region: 'west',
xtype: 'tree',
title: 'west',
store:'CCH3.store.ClassifyTree',
width: 400,


columns: [
{xtype:'treecolumn',text:'Caption',dataIndex:'Caption', width:200}
]


}

but i've got error:
Uncaught Ext.data.proxy.Server.buildUrl(): You are using a ServerProxy but have not supplied it with a url.

But as you can see - i do have URL config in my store. What's wrong with my code?

Mubin
23 Feb 2014, 3:42 AM
I'm using Ext JS 4.2.1.

Mubin
23 Feb 2014, 8:37 AM
Solved. Problem was with config object when defining classes. When I removed 'config' it worked as it should.