|
思想是 attmentchsimple 上传直接在下面list显示 我在另一个页面也是同样的步骤 是用butt按钮显示的,,在这里我想直接显示,,不知道是不是DataValueChanged函数原因,,我猜应该不是 ,, 当attmentchsimple上传一次时 listData就会被覆盖,,只能上传一张, attmentchsimple绑定的是attData,,求原因
//当上传照片 时 将照片赋值到listData
Model.prototype.attDataValueChanged = function(event){
var data =this.comp('attData');
var id =justep.Shell.userId.get();
var count = this.comp('listData').count();
if (data.val('image') != null && data.val('image') != "" && data.val('image') != "[]") {
image = eval("(" + data.val('image') + ")");
}
var max =image.length;
var img =""
if(count + max > 20)
{ justep.Util.hint("最多只能上传20张");
}else{
for(var i=0;i<max;i++){
img= image[i] ? JSON.stringify(image[0]) : null;
this.comp('listData').newData({
"defaultValues" : [ {
"image" : img,
"id":justep.UUID.createUUID(),
} ]
});
this.comp('attData').clear()
this.comp('attData').newData({
"defaultValues" : [ {
"id" : id,
"image" : ""
} ]
});
}}
};
|
|