|
|
@@ -93,10 +93,41 @@
|
|
|
$menu.find('li').click(function () {
|
|
|
var type = $(this).data('type'),
|
|
|
doExport = function () {
|
|
|
+
|
|
|
+ if (!!that.options.exportFooter) {
|
|
|
+ var data = that.getData();
|
|
|
+ var $footerRow = that.$tableFooter.find("tr").first();
|
|
|
+
|
|
|
+ var footerData = { };
|
|
|
+ var footerHtml = [];
|
|
|
+
|
|
|
+ $.each($footerRow.children(), function (index, footerCell) {
|
|
|
+
|
|
|
+ var footerCellHtml = $(footerCell).children(".th-inner").first().html();
|
|
|
+ footerData[that.columns[index].field] = footerCellHtml == ' ' ? null : footerCellHtml;
|
|
|
+
|
|
|
+ // grab footer cell text into cell index-based array
|
|
|
+ footerHtml.push(footerCellHtml);
|
|
|
+ });
|
|
|
+
|
|
|
+ that.append(footerData);
|
|
|
+
|
|
|
+ var $lastTableRow = that.$body.children().last();
|
|
|
+
|
|
|
+ $.each($lastTableRow.children(), function (index, lastTableRowCell) {
|
|
|
+
|
|
|
+ $(lastTableRowCell).html(footerHtml[index]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
that.$el.tableExport($.extend({}, that.options.exportOptions, {
|
|
|
type: type,
|
|
|
escape: false
|
|
|
}));
|
|
|
+
|
|
|
+ if (!!that.options.exportFooter) {
|
|
|
+ that.load(data);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
if (that.options.exportDataType === 'all' && that.options.pagination) {
|