我已经安装了我的感觉触觉应用程序,我认为它应该是,当我把它加载到Chrome时,Javascript控制台不会抛出任何错误。WebService终于返回了适当的数据,但是由于某些原因,我无法理解为什么面板是空白的。
这是应用程序URL
http://rpcm.infinitas.ws/
这是WebService网址
dc=1308083451839&limit=25&callback=stcCallback1001
这是一些相关的代码。
控制器
rpc.controllers.VimeoController = new Ext.Panel(
rpc.views.Vimeo.index
);视图
rpc.views.Vimeo.index = {
id: 'VideoView',
title: 'Videos',
tpl: rpc.templates.VimeoTemplate,
iconCls: 'tv',
dockedItems: [{ xtype: 'toolbar', title: 'Videos'}],
store: 'rpc.stores.VimeoStore'
};商店
rpc.stores.VimeoStore = new Ext.data.Store({
id: 'VimeoStore',
model: 'rpc.models.VimeoModel',
proxy: {
type: 'scripttag',
url: WebService('Vimeo', 'Read'),
method: 'GET',
reader: {
type: 'json',
root: 'results'
}
},
autoLoad: true
});模型
rpc.models.VimeoModel = Ext.regModel('rpc.models.VimeoModel', {
fields: [
{name: 'id', type: 'int'},
{name: 'title', type: 'string'}
]
});模板
rpc.templates.VimeoTemplate = new Ext.XTemplate([
'<tpl for=".">',
'<div>',
'{title}',
'</div>',
'</tpl>'
]);JSON反应
StcCallback1001({“结果”:{“id”:25036464,“标题”:“投降生命的力量:告别布道”},{"id":25036610,“标题”:“2011年6月儿童奉献”},{"id":24734142,“标题”:“自首生命的力量:联系”},{"id":24884833,标题:“2011年6月财务更新”},{"id":24587711,“标题”:“巴布亚,印度尼西亚共享2011年5月”},{"id":24232427,“标题”:“伊克索:即将到来的国王”},{"id":23868560,“标题”:“id:疗愈者”},{"id":23486615,“标题”:“id: Sanctifier"},{"id":23211649,”title“:”id: Saviour"},{"id":23867961,"title":"Elder另行通知: Brent Trask"},{"id":22998163,"title":"Triumph of Grace:升起的主“} {"id":23687914,“标题”:“格雷斯的胜利:王位国王”},{"id":23692076,“标题”:“现在的王国:因为你是王国”},{"id":23694183,“标题”:“现在的王国:把我们从邪恶中解救出来”},“成功”:真});
任何帮助或指导都将不胜感激。
发布于 2011-06-15 04:34:18
您提供的示例响应看起来像JSONP,而不是普通的JSON。你可能想要一个Ext.data.proxy.JsonP。
要使用这个,您可以将您的商店更改为如下所示:
rpc.stores.VimeoStore = new Ext.data.Store({
id: 'VimeoStore',
model: 'rpc.models.VimeoModel',
proxy: {
type: 'jsonp',
url: WebService('Vimeo', 'Read'),
reader: {
type: 'json',
root: 'results'
}
},
autoLoad: true
});祝你好运!
发布于 2011-11-08 08:00:22
从视图中删除''。
写这个:
商店: rpc.stores.VimeoStore
https://stackoverflow.com/questions/6352466
复制相似问题