Skip to content

Add search option with local data in html #2565

Discussion options

You must be logged in to vote

How would you expect the searchable data as DOM nodes being structured? dropdown and popup are HTML markup themselves, but data for search is always an object.
So, you can at least already use the source setting to provide an already existing data object

https://fomantic-ui.com/modules/search.html#/usage

var
  content = [
    {
      title: 'Horse',
      description: 'An Animal',
    },
    {
      title: 'Cow',
      description: 'Another Animal',
    }
  ]
;
$('.ui.search')
  .search({
    source : content,
    searchFields   : [
      'title'
    ],
    fullTextSearch: false
  })
;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lubber-de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants