列表无图的时候,使用一个透明图片替代

pull/18/head
李云龙 2017-09-08 21:44:51 +08:00 committed by GitHub
parent 20c7963e22
commit f2fda511a2
1 changed files with 2 additions and 0 deletions

View File

@ -298,6 +298,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
return '<i class="' + value + '"></i> ' + value;
},
image: function (value, row, index) {
value=value?value:'/assets/img/blank.gif';
var classname = typeof this.classname !== 'undefined' ? this.classname : 'img-sm img-center';
return '<img class="' + classname + '" src="' + Fast.api.cdnurl(value) + '" />';
},
@ -306,6 +307,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
var arr = value.split(',');
var html = [];
$.each(arr, function (i, value) {
value=value?value:'/assets/img/blank.gif';
html.push('<img class="' + classname + '" src="' + Fast.api.cdnurl(value) + '" />');
});
return html.join(' ');