diff --git a/inst/htmlwidgets/lib/datatables-extensions/Buttons/js/buttons.html5.min.js b/inst/htmlwidgets/lib/datatables-extensions/Buttons/js/buttons.html5.min.js index 4e9a4498..fe89fcdf 100644 --- a/inst/htmlwidgets/lib/datatables-extensions/Buttons/js/buttons.html5.min.js +++ b/inst/htmlwidgets/lib/datatables-extensions/Buttons/js/buttons.html5.min.js @@ -52,9 +52,9 @@ } function K(a, b) { - var d = - a.header[b].length, - c; + //var d = a.header[b].length + for (var d = 0, o = 0; o d && (d = a.footer[b].length); for (var f = 0, g = a.body.length; f < g; f++) if (c = a.body[f][b], c = null !== c && c !== s ? c.toString() : "", -1 !== c.indexOf("\n") ? (c = c.split("\n"), c.sort(function(a, c) { @@ -441,17 +441,27 @@ i("row:eq(" + (a - 1) + ") c", e).attr("s", "51") }, p = b.buttons.exportInfo(c); - p.title && (r([p.title], g), k(g, d.header.length - 1)); + p.title && (r([p.title], g), k(g, /*d.header.length*/ d.header[d.header.length - 1].length - 1)); p.messageTop && (r([p.messageTop], - g), k(g, d.header.length - 1)); - c.header && (r(d.header, g), i("row:last c", e).attr("s", "2")); + g), k(g, /*d.header.length*/ d.header[d.header.length - 1].length - 1)); + /* ----- BEGIN added Code ----- */ + //c.header && (r(d.header, g), i("row:last c", e).attr("s", "2")); + + if(c.header){ + for (o = 0; o < d.header.length; o++){ + r(d.header[o], g); + i("row:last c", e).attr("s", "2"); + } + } + + /*END added code*/ for (var o = 0, u = d.body.length; o < u; o++) r(d.body[o], g); c.footer && d.footer && (r(d.footer, g), i("row:last c", e).attr("s", "2")); - p.messageBottom && (r([p.messageBottom], g), k(g, d.header.length - 1)); + p.messageBottom && (r([p.messageBottom], g), k(g, /*d.header.length*/d.header[d.header.length - 1].length - 1)); r = q(e, "cols"); i("worksheet", e).prepend(r); k = 0; - for (o = d.header.length; k < o; k++) r.appendChild(q(e, "col", { + for (o = /*d.header.length*/d.header[d.header.length - 1].length; k < o; k++) r.appendChild(q(e, "col", { attr: { min: k + 1, max: k + 1,