From d3917969b4e6c35e5691500e585984d98f662783 Mon Sep 17 00:00:00 2001 From: robiinho Date: Thu, 10 Jun 2021 10:35:52 +0100 Subject: [PATCH] add tfoot options Add "actions" column in tfoot (best look) if tfoot set to true --- bstable.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bstable.js b/bstable.js index 7cfae34..9d1a97f 100644 --- a/bstable.js +++ b/bstable.js @@ -23,6 +23,7 @@ class BSTable { var defaults = { editableColumns: null, // Index to editable columns. If null all td will be editable. Ex.: "1,2,3,4,5" + tfoot: false, $addButton: null, // Jquery object of "Add" button onEdit: function() {}, // Called after editing (accept button clicked) onBeforeDelete: function() {}, // Called before deletion @@ -72,7 +73,10 @@ class BSTable { init() { this.table.find('thead tr').append('' + this.options.advanced.columnLabel + ''); // Append column to header this.table.find('tbody tr').append(this.actionsColumnHTML); - + if (this.options.tfoot) { + this.table.find('tfoot tr').append('' + this.options.advanced.columnLabel + ''); // Append column to footer + } + this._addOnClickEventsToActions(); // Add onclick events to each action button in all rows // Process "addButton" parameter