简体   繁体   中英

Blank Search - Semantic UI

I'm trying to implement the Semantic-UI search module in my app prototype.

But it's showing the results as a blank component ->

LINK

The app is running with the Node-Webkit

JS Code:

$(document).ready(function() {
            $('.ui.search.agendamento').search({
                source : agendamento,
                searchFields   : [
                    'patient',
                ],
                searchFullText: false
            });
        });

HTML

<div class="ui fluid search agendamento">
                    <div class="ui icon input">
                        <input class="prompt" type="text" placeholder="Buscar consulta">
                        <i class="search icon"></i>
                    </div>
                    <div class="results"></div>
</div>

My problem was in the result json array from the Semantic-UI Search.

It needs to be formated correctly like:

{
  "results": [
    {
      "title": "Result Title",
      "url": "/optional/url/on/click",
      "image": "optional-image.jpg",
      "price": "Optional Price"
      "description": "Optional Description"
    },
    {
      "title": "Result Title",
      "description": "Result Description"
    }
  ],
  // optional action below results
  "action": {
    "url": '/path/to/results'
    "text": "View all 202 results"
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM