Skip to content

Commit

Permalink
Update bootstrap-table-print.js
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhixin authored Jan 12, 2018
1 parent 9116a86 commit d49413f
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions src/extensions/print/bootstrap-table-print.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,39 +70,37 @@
}

function buildTable(data, columnsArray) {
var out = "<table><thead>";
for(var k = 0; k < columnsArray.length; k++) {
var html = ['<table><thead>'];
for (var k = 0; k < columnsArray.length; k++) {
var columns = columnsArray[k];
out += "<tr>";
for(var h = 0; h < columns.length; h++) {
html.push('<tr>');
for (var h = 0; h < columns.length; h++) {
if (!columns[h].printIgnore) {
out += "<th ";
if (columns[h].rowspan) {
out += (" rowspan='" + columns[h].rowspan + "'");
}
if (columns[h].colspan) {
out += (" colspan='" + columns[h].colspan + "'");
}
out += (">" + columns[h].title + "</>");
html.push(
'<th',
sprintf(' rowspan="%s"', columns[h].rowspan),
sprintf(' colspan="%s"', columns[h].colspan),
sprintf('>%s</th>', columns[h].title)
);
}
}
out += "</tr>";
html.push('</tr>');
}
out += "</thead><tbody>";
for(var i = 0; i < data.length; i++) {
out += "<tr>";
html.push('</thead><tbody>');
for (var i = 0; i < data.length; i++) {
html.push('<tr>');
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 += ("<td>" + formatValue(data[i], i, columns[j]) + "</td>");
html.push('<td>', formatValue(data[i], i, columns[j]), '</td>');
}
}
}
out += "</tr>";
html.push('</tr>');
}
out += "</tbody></table>";
return out;
html.push('</tbody></table>');
return html.join('');
}
function sortRows(data,colName,sortOrder) {
if(!colName){
Expand Down

0 comments on commit d49413f

Please sign in to comment.