0
我尝试在我的Sencha触摸应用程序中显示一些数据,但它不起作用...并且我找不到我做错了什么。使用web服务加载senchaTouch应用程序中的数据返回json
我webSiste返回谁像这样
[{"name":"a","id":1}]
脚本获取JSON和显示它JSON对象:
Ext.regApplication({ name: 'Command',
phoneStartupScreen: 'phone-startup.png',
phoneIcon: 'apple-touch-icon.png',
launch: function(){
this.viewport = new Ext.Panel(
{
layout: 'fit',
fullscreen: true,
items: [{xtype: 'list',
itemTpl: new Ext.XTemplate('<div>{name}</div>'),
store: stores
}],
dockedItems: [{xtype: "toolbar",
dock: "top",
title: 'MovieCommand',
items: [{ui: 'back',text: 'back',handler: function(){}}]
}]
});
}
});
Ext.regModel('Commands', {
fields: ['name', 'id' ]
});
var stores = new Ext.data.Store(
{model: 'Commands',
proxy: {type: 'scripttag',
url: 'http://localhost:8080/GTI710/commandes/liste.htm',
format: 'sencha',
reader: new Ext.data.JsonReader ({
type: 'json',
})
},
});
stores.load();
我没有任何错误在java脚本,但没有显示。 我只想显示“a”但它不起作用,我不知道为什么...
感谢您的帮助,我终于成功地做了我想做的事情 – Musashi974