PDA

View Full Version : Uncaught TypeError: Cannot call method 'getProxy' of undefined



kjcr
15 Oct 2012, 9:38 PM
Ext.define('project_val',{
extend:'Ext.data.Model',
fields:['success'],
proxy:{
type: 'ajax',
url:'resource/json/result.json',
reader:{
type:'json',
root:'root'
}
},
hasmany: {model:'items',name:'items'}
});

var project_val = Ext.create('Ext.data.Store', {
model: 'project_val',
autoLoad : true,
/*proxy:{
type: 'ajax',
//url:'resource/json/result.json',
api:{
read:'resource/json/result.json'
}
}*/
});

I use grid as view
but my app show this message
'Uncaught TypeError: Cannot call method 'getProxy' of undefined '

please help me.

vietits
15 Oct 2012, 11:14 PM
I have tried your code with Ext 4.1.1 and Chrome and did not encounter the error you mentioned.


Ext.onReady(function(){
Ext.define('project_val',{
extend:'Ext.data.Model',
fields:['success'],
proxy:{
type: 'ajax',
url:'resource/json/result.json',
reader:{
type:'json',
root:'root'
}
},
// hasmany: {model:'items',name:'items'}
hasMany: {model:'items',name:'items'}
});



var project_val = Ext.create('Ext.data.Store', {
model: 'project_val',
autoLoad : true,
/*proxy:{
type: 'ajax',
//url:'resource/json/result.json',
api:{
read:'resource/json/result.json'
}
}*/
});
});

kjcr
16 Oct 2012, 12:02 AM
thanx.
i'm new to Extjs.
it's my fault.:(