|
发表于 2017-7-12 14:29:20
|
显示全部楼层
轮播生成img的时候就设置onclick- Model.prototype.modelLoad = function(event) {
- var self = this;
- var data = self.comp("bizData1");
- var carousel = self.comp("carousel1");
- data.each(function(param){
- var sphoto = param.row.val("fAttachmentPicture");
- if (sphoto != null && sphoto != "" && sphoto != "[]") {
- var imageJson = eval("(" + sphoto + ")");
- if (imageJson.length > 0) {
- var fileID = imageJson[0]["fileID"];
- var docPath = imageJson[0]["docPath"];
- var url = DocUtils.InnerUtils.getdocServerAction({
- "docPath" : docPath,
- urlPattern : "/repository/file/view/" + fileID + "/last/content",
- isFormAction : false,
- context : self.getContext()
- });
- var rowid = param.row.getID();
- carousel.add('<img src="' + url + '" class="tb-img1" onclick=justep.Bind.contextFor(this).$model.imgClick("'+ rowid +'")></img>');
- }
- self.comp("contents1").to(0);
- }
- });
- };
-
- Model.prototype.imgClick = function(rowid){
- alert(rowid);
- }
复制代码
|
|