- + + -
+ <%- compactData[i]["Company Name"] %> +
+ + + -- <%- compactData[i]["Company Name"] %> -
- - - -- <%- totalData[i]["Company Name"] %> -
-+ <%- totalData[i]["Company Name"] %> +
+- $40,342.04 -
+$40,342.04
Total Portfolio -- $ 40,342.04 -
+$ 40,342.04
Profit / Loss +- $40,342.04 -
+$40,342.04
$ Balance +- Jan 21, 2020 -
+Jan 21, 2020
- Gdax -
+Gdax
@@ -195,14 +192,10 @@
- Jan 8, 2020 -
+Jan 8, 2020
- Bitterx -
+Bitterx
@@ -230,14 +223,10 @@
- Jan 21, 2020 -
+Jan 21, 2020
- Gdax -
+Gdax
@@ -264,14 +253,10 @@
- Jan 8, 2020 -
+Jan 8, 2020
- Bitterx -
+Bitterx
@@ -299,14 +284,10 @@
- Jan 21, 2020 -
+Jan 21, 2020
- Gdax -
+Gdax
@@ -334,14 +315,10 @@
- Jan 8, 2020 -
+Jan 8, 2020
- Bitterx -
+Bitterx
@@ -528,36 +505,36 @@ \ No newline at end of file + const inputField = document.getElementById('searchbar') + inputField.addEventListener('input', (event) => { + console.log(event.target.value) + const value = event.target.value + //sample data + const dataset = <%- JSON.stringify(totalData) %>; + + // when symbol matches + + let data = dataset.filter(function(el) { + return el.Symbol.includes(value.toUpperCase()) + }) + + // when no symbol matches + + if (data.length === 0) { + + let data1 = dataset.filter(function(el) { + return (el["Company Name"].toLowerCase().includes(value.toLowerCase())) + }) + data = data1; + } + + let list = ""; + if (value === "") { + list = ""; + data = []; + } + let n = data.length + for (i = 0; i <= (n - 1); i++) { + let item = data[i]; + list += `