OSDN Git Service

各種報告書の表の全体検索を正規表現にする
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Tue, 9 Apr 2019 13:06:24 +0000 (22:06 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Sat, 13 Apr 2019 12:35:27 +0000 (21:35 +0900)
LogViewer/tags.tag

index 9521826..1d9611f 100644 (file)
@@ -175,6 +175,7 @@ this.setHeaderAndFooter = function(table, header) {
 
 this.searchSetup = function(dTable) {
     self.setupCellSearch(dTable);
+    self.setupGlobalSearch(dTable);
 };
 
 this.setupCellSearch = function(dTable) {
@@ -187,6 +188,15 @@ this.setupCellSearch = function(dTable) {
     });
 };
 
+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
+};
+
 this.show = function() {
     if (this.mainTab >= this.jsons.length)
         return;