From 882a2a3d9d3b7039826185dd64ccedbfee998fcb Mon Sep 17 00:00:00 2001
From: Blake Gearin <blakegearin@pm.me>
Date: Fri, 30 Dec 2022 11:20:33 +0000
Subject: [PATCH] Add option to remove filter on table charts

---
 layouts/shortcodes/chart.html                            |    2 ++
 exampleSite/content/docs/compose/graphs-charts-tables.md |   10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/exampleSite/content/docs/compose/graphs-charts-tables.md b/exampleSite/content/docs/compose/graphs-charts-tables.md
index 9f3b08a..65bc158 100644
--- a/exampleSite/content/docs/compose/graphs-charts-tables.md
+++ b/exampleSite/content/docs/compose/graphs-charts-tables.md
@@ -90,8 +90,14 @@
   {{< chart "dataset2" "pie,doughnut" "1" >}}
 {{< /grid >}}
 
-#### Show table only
+#### Show table with filter
 
 {{< grid "3" >}}
   {{< chart "dataset2" "table" >}}
-{{< /grid >}}
\ No newline at end of file
+{{< /grid >}}
+
+#### Show table only
+
+{{< grid "3" >}}
+  {{< chart "dataset2" "table,noFilter" >}}
+{{< /grid >}}
diff --git a/layouts/shortcodes/chart.html b/layouts/shortcodes/chart.html
index 0c3842f..ad81b90 100644
--- a/layouts/shortcodes/chart.html
+++ b/layouts/shortcodes/chart.html
@@ -27,9 +27,11 @@
 {{- if in $charts "table" }}
 <script src = '{{ absURL "js/w3.js" }}'></script>
 <div class="table_wrap">
+  {{- if not (in $charts "noFilter") }}
   <p>
     <input oninput="w3.filterHTML('#chartTable', '.row', this.value)" class="form_search search_field" placeholder="Filter Table Values">
   </p>
+  {{- end }}
   <table id="chartTable">
     <thead>
       {{- range $index, $title := $data.columnTitles }}

--
Gitblit v1.10.0