Add search option with local data in html #2565
-
Currently we have an option of local search with data that is inserted through js code. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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. 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
})
; |
Beta Was this translation helpful? Give feedback.
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 objecthttps://fomantic-ui.com/modules/search.html#/usage