diff --git a/views/market.ejs b/views/market.ejs index ee4c282..8ad93f0 100644 --- a/views/market.ejs +++ b/views/market.ejs @@ -1,9 +1,45 @@
-
-

Favorite Stocks

+
+
+ +

Favorite Stocks

+
+ + +
+
+
+ + +
+ +
    + + +
    +
    -
    +
    <% for(var i=0; i < compactData.length; i++) { %> @@ -141,3 +177,47 @@ } } + + + + \ No newline at end of file diff --git a/views/portfolio.ejs b/views/portfolio.ejs index 8f79d21..a5069d0 100644 --- a/views/portfolio.ejs +++ b/views/portfolio.ejs @@ -1,13 +1,11 @@
    -
    - +
    + - + -
    - Hello, + Hello,
    -
    +
    +
    - + -
    -
    +
    +
     -
    -
    +
    +

    - $ 40,342.04 + $ 40,342.04

    Profit / Loss -
    +
    - + -
    -
    +
    +
     -
    -
    +
    +

    - $40,342.04 + $40,342.04

    $ Balance -
    -
    +
    +
    @@ -117,14 +111,13 @@
    - + -
    -
    - -

    Trade History

    - View All > +
    + +

    Trade History

    + View All >
    @@ -542,10 +535,22 @@ //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 = ""; @@ -555,4 +560,4 @@ for (i = 0; i <= (n - 1); i++) { let item = data[i]; list += `
  • ${item.Symbol}
  • ` } document.getElementById('search-result').innerHTML = list ;console.log(data) }) - + \ No newline at end of file