+ return entries;
+};
+
+this.setHeaderAndFooter = function(table, header) {
+ table.find("thead tr").first().html(header);
+ var footer = table.find("tfoot tr");
+ table.find("th").each(function(index) {
+ footer.append(
+ '<th style="padding: 1px"><input style="min-width: 100%" size="1" type="search" placeholder="Search ' +
+ $(this).text() + '"/></th>');
+ });
+};
+
+this.searchSetup = function(dTable) {
+ self.setupCellSearch(dTable);
+ self.setupGlobalSearch(dTable);
+};
+
+this.setupCellSearch = function(dTable) {
+ dTable.columns().every(function() {
+ var that = this;
+ that.search(""); // reset
+ $('input', this.footer()).on("input search", function() {
+ that.search(this.value, true, false).draw();
+ });
+ });
+};
+
+this.setupGlobalSearch = function(dTable) {
+ var searchLabel = $(dTable.table().container()).find(".dataTables_filter label").first();
+ searchLabel.html('Search: <input type="search">');
+ searchLabel.children("input").first().on("input search", function() {
+ dTable.search(this.value, true, false).draw();
+ });
+ dTable.search(""); // reset