From d49413f2f5e4c1144bb1b26d559e758475548721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E7=BF=BC?= Date: Fri, 12 Jan 2018 23:55:24 +0800 Subject: [PATCH] Update bootstrap-table-print.js --- src/extensions/print/bootstrap-table-print.js | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/extensions/print/bootstrap-table-print.js b/src/extensions/print/bootstrap-table-print.js index aab0a7ffba..881d9cba7a 100644 --- a/src/extensions/print/bootstrap-table-print.js +++ b/src/extensions/print/bootstrap-table-print.js @@ -70,39 +70,37 @@ } function buildTable(data, columnsArray) { - var out = ""; - for(var k = 0; k < columnsArray.length; k++) { + var html = ['
']; + for (var k = 0; k < columnsArray.length; k++) { var columns = columnsArray[k]; - out += ""; - for(var h = 0; h < columns.length; h++) { + html.push(''); + for (var h = 0; h < columns.length; h++) { if (!columns[h].printIgnore) { - out += "', columns[h].title) + ); } } - out += ""; + html.push(''); } - out += ""; - for(var i = 0; i < data.length; i++) { - out += ""; + html.push(''); + for (var i = 0; i < data.length; i++) { + html.push(''); for(var l = 0; l < columnsArray.length; l++) { var columns = columnsArray[l]; for(var j = 0; j < columns.length; j++) { if (!columns[j].printIgnore && columns[j].field) { - out += (""); + html.push(''); } } } - out += ""; + html.push(''); } - out += "
" + columns[h].title + ""); + html.push( + '%s
" + formatValue(data[i], i, columns[j]) + "', formatValue(data[i], i, columns[j]), '
"; - return out; + html.push(''); + return html.join(''); } function sortRows(data,colName,sortOrder) { if(!colName){