我正在尝试使用EXT JS 4、Sencha Touch 2.0和WebORB。
我正在尝试通过Ext在Sencha Touch的MVC中构建一个商店。我调用了下面的javascript函数,在Index.html中的部分中如下所示:
<script src="sencha-touch-all.js"></script>
<script src="webORB.js"></script>
<script>
var dataFetched;
var dataGet=function(){
<!-- Class Name and URL are replaced in the original program-->
this.proxy = webORB.bind("ClassName", "URL");
dataFetched=this.proxy.GetClassList(1301722);
//console.log(dataFetched);
}
</script>
<script src="app.js">
</script>以下是我的app.js
Ext.Loader.setConfig({
enabled: true
});
Ext.application({
name: 'SBR',
controllers: [
'Main','Blog','Comments'
],
views : [
'Home','Blog', 'Comments'
],
models : ['Comments'],
stores: ['Comments'],
launch: function(){
dataGet();
console.log(dataFetched);
Ext.create('SBR.view.Viewport');
}
});以下是我的Comment.js商店
Ext.define('SBR.store.Comments',{
extend: 'Ext.data.Store',
config: {
model: 'SBR.model.Comments',
data: dataFetched
}
});以下是Comment.js -模型
Ext.define('SBR.model.Comments',{
extend: 'Ext.data.Model',
config: {
//fields: ['subject','body']
fields: ['bookImageUrl','authorFirstName','authorLastName']
}
})下面是Comment.js -视图
Ext.define('SBR.view.Comments',{
extend: 'Ext.List',
xtype: 'commentspage',
config:{
title: 'Comments',
iconCls: 'star',
//indexBar: true,
store : 'Comments',
itemTpl: '{authorLastName}',
onItemDisclosure: function(item) {
console.log('Disclose more info on' + " " + item.data.subject);
}
}
});如果我用静态Json数据定义了存储,它就可以正常工作,但是当我尝试用WebORB访问它时,它就没有了。
控制台条目是在它向控制台显示数据之前完成的。为什么它没有在评论的视图中显示任何数据,或者我的方法在通过WebORB收集数据并加载到商店时是完全错误的?
发布于 2013-05-20 06:02:00
哦是的..。我拿到了..。
我只是改变了以下几点:
数据: dataGet()
it...it成功了..。
https://stackoverflow.com/questions/16612609
复制相似问题