DevKevin
26 Apr 2011, 12:23 AM
Hi,
Firstly, I'm new in developing Sencha touch.
I've a file with my model and my store :
Ext.regModel("mvcproject.models.myModel", {
fields: [
{name: 'sCode'},
{name: 'sDescription'}
],
});
mvcproject.stores.myModel = new Ext.data.Store({
autoLoad: true,
model: 'mvcproject.models.myModel',
extraParams: {
format: 'json',
},
proxy: {
type: 'scripttag',
url: 'http://footballpool.dataaccess.eu/data/info.wso/AllGroupCompetitors/JSON',
reader: {
type:'json',
root:"GroupInfo"
}
}
});
and another file containing my view :
mvcproject.views.viewOne = Ext.extend(Ext.Panel, {
dockedItems: [{
xtype: 'toolbar',
title: 'MVC Project'
},
{
xtype: 'toolbar',
title:'<h1>Accueil</h1>',
ui:'light',
cls:'sencha-toolbar'
},
{
xtype: 'tabbar',
dock : 'bottom',
ui : 'dark',
layout: {
pack: 'center'
},
items: [{
text: 'Accueil',
icon:'lib/touch/resources/icon/home-news.png',
iconMask:false,
handler: function () {
Ext.dispatch({
controller: mvcproject.controllers.myController,
action: 'goToHome'
})
},
scope:this
},
{
text: 'A propos',
icon:'lib/touch/resources/icon/home-about.png',
handler: function () {
Ext.dispatch({
controller: mvcproject.controllers.myController,
action: 'goToAbout'
})
},
scope:this
}
]
}],
items : [{
title:'grouplist',
cls:'grouplist',
xtype: 'list',
store: mvcproject.stores.myModel,
itemTpl: '{sDescription}',
fullscreen: true
}],
initComponent: function() {
console.log('View One');
mvcproject.views.viewOne.superclass.initComponent.apply(this, arguments);
}
});
In fact, I can not get data from JSON..
I've a warning in console :
"Resource interpreted as Script but transferred with MIME type application/json."
I hope you could help me.
Thank you.
Firstly, I'm new in developing Sencha touch.
I've a file with my model and my store :
Ext.regModel("mvcproject.models.myModel", {
fields: [
{name: 'sCode'},
{name: 'sDescription'}
],
});
mvcproject.stores.myModel = new Ext.data.Store({
autoLoad: true,
model: 'mvcproject.models.myModel',
extraParams: {
format: 'json',
},
proxy: {
type: 'scripttag',
url: 'http://footballpool.dataaccess.eu/data/info.wso/AllGroupCompetitors/JSON',
reader: {
type:'json',
root:"GroupInfo"
}
}
});
and another file containing my view :
mvcproject.views.viewOne = Ext.extend(Ext.Panel, {
dockedItems: [{
xtype: 'toolbar',
title: 'MVC Project'
},
{
xtype: 'toolbar',
title:'<h1>Accueil</h1>',
ui:'light',
cls:'sencha-toolbar'
},
{
xtype: 'tabbar',
dock : 'bottom',
ui : 'dark',
layout: {
pack: 'center'
},
items: [{
text: 'Accueil',
icon:'lib/touch/resources/icon/home-news.png',
iconMask:false,
handler: function () {
Ext.dispatch({
controller: mvcproject.controllers.myController,
action: 'goToHome'
})
},
scope:this
},
{
text: 'A propos',
icon:'lib/touch/resources/icon/home-about.png',
handler: function () {
Ext.dispatch({
controller: mvcproject.controllers.myController,
action: 'goToAbout'
})
},
scope:this
}
]
}],
items : [{
title:'grouplist',
cls:'grouplist',
xtype: 'list',
store: mvcproject.stores.myModel,
itemTpl: '{sDescription}',
fullscreen: true
}],
initComponent: function() {
console.log('View One');
mvcproject.views.viewOne.superclass.initComponent.apply(this, arguments);
}
});
In fact, I can not get data from JSON..
I've a warning in console :
"Resource interpreted as Script but transferred with MIME type application/json."
I hope you could help me.
Thank you.