|

楼主 |
发表于 2017-6-28 14:32:48
|
显示全部楼层
temp.js
define(function(require){
var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
var Model = function(){
this.callParent();
};
var shuju = [
{
"bookId":1,
"bookName":"平凡的世界",
"theme":"剧情",
"writer":"路遥",
"img":"./img/pic1.png",
"fenfaCount":"115",
"commentCount":"1"
},
{
"bookId":2,
"bookName":"兄弟",
"theme":"剧情",
"writer":"余华",
"img":"./img/pic2.png",
"fenfaCount":"11",
"commentCount":"2"
},
{
"bookId":3,
"bookName":"白鹿原",
"theme":"叙事",
"writer":"陈忠实",
"img":"./img/pic3.png",
"fenfaCount":"14",
"commentCount":"3"
}
];
Model.prototype.data1CustomRefresh = function(event){
event.source.loadData(shuju);
};
Model.prototype.contents1ActiveChange = function(event){
var data1 = this.comp("data1");
alert(event.type);
if(event.type == "prev"){
data1.prev();
}else{
data1.next();
}
};
return Model;
});
C:\Users\Wangman\Desktop\1.PNG
你第二条说的是用.add方法追加一个content吗,可是追加的content中控件和布局都需要重新画吧,这样就更麻烦了,要是这样还真不如直接在contents下循环json数据的list呢 |
-
|