DmitrMakeev commited on
Commit
9722b56
1 Parent(s): 0aeade1

Update data_gc_tab.html

Browse files
Files changed (1) hide show
  1. data_gc_tab.html +44 -9
data_gc_tab.html CHANGED
@@ -1,5 +1,3 @@
1
-
2
-
3
  <!DOCTYPE html>
4
  <html lang="en">
5
  <head>
@@ -93,6 +91,10 @@
93
  <div id="header">
94
  <h1>База синхронизации с GetCourse</h1>
95
  </div>
 
 
 
 
96
  <div id="example-table"></div>
97
 
98
  <script>
@@ -167,13 +169,46 @@
167
  {title:"utm_term", field:"pr4"},
168
  {title:"utm_content", field:"pr5"}
169
  ],
170
- // Добавление фильтрации и поиска
171
- initialFilter: [
172
- {field: "curator", type: "like", value: ""}
173
- ],
174
- headerFilterPlaceholder: "Поиск...",
175
- headerFilterLiveFilter: true,
176
- headerFilterFunc: "like"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  });
178
  })
179
  .catch(error => console.error('Error fetching data:', error));
 
 
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
  <head>
 
91
  <div id="header">
92
  <h1>База синхронизации с GetCourse</h1>
93
  </div>
94
+ <div>
95
+ <input id="filter-value" type="text" placeholder="value to filter">
96
+ <button id="filter-clear">Clear Filter</button>
97
+ </div>
98
  <div id="example-table"></div>
99
 
100
  <script>
 
169
  {title:"utm_term", field:"pr4"},
170
  {title:"utm_content", field:"pr5"}
171
  ],
172
+ });
173
+
174
+ // Define variables for input elements
175
+ var valueEl = document.getElementById("filter-value");
176
+
177
+ // Trigger setFilter function with correct parameters
178
+ function updateFilter() {
179
+ var filterVal = valueEl.value;
180
+
181
+ if (filterVal) {
182
+ table.setFilter([
183
+ {field: "id", type: "like", value: filterVal},
184
+ {field: "name", type: "like", value: filterVal},
185
+ {field: "phone", type: "like", value: filterVal},
186
+ {field: "email", type: "like", value: filterVal},
187
+ {field: "curator", type: "like", value: filterVal},
188
+ {field: "shop_statys_full", type: "like", value: filterVal},
189
+ {field: "ad_url", type: "like", value: filterVal},
190
+ {field: "vk_id", type: "like", value: filterVal},
191
+ {field: "chat_id", type: "like", value: filterVal},
192
+ {field: "ws_statys", type: "like", value: filterVal},
193
+ {field: "ws_stop", type: "like", value: filterVal},
194
+ {field: "web_statys", type: "like", value: filterVal},
195
+ {field: "fin_progress", type: "like", value: filterVal},
196
+ {field: "pr1", type: "like", value: filterVal},
197
+ {field: "pr2", type: "like", value: filterVal},
198
+ {field: "pr3", type: "like", value: filterVal},
199
+ {field: "pr4", type: "like", value: filterVal},
200
+ {field: "pr5", type: "like", value: filterVal}
201
+ ]);
202
+ }
203
+ }
204
+
205
+ // Update filters on value change
206
+ document.getElementById("filter-value").addEventListener("keyup", updateFilter);
207
+
208
+ // Clear filters on "Clear Filters" button click
209
+ document.getElementById("filter-clear").addEventListener("click", function() {
210
+ valueEl.value = "";
211
+ table.clearFilter();
212
  });
213
  })
214
  .catch(error => console.error('Error fetching data:', error));