Search category mode broken?
var source =
{
"category1": {
"name": "Category 1",
"results": [
{
"title": "Result Title",
"url": "/optional/url/on/click",
"image": "optional-image.jpg",
"price": "Optional Price",
"description": "Optional Description"
},
{
"title": "Result Title",
"url": "/optional/url/on/click",
"image": "optional-image.jpg",
"price": "Optional Price",
"description": "Optional Description"
}
]
},
"category2": {
"name": "Category 2",
"results": [
{
"title": "Result Title",
"url": "/optional/url/on/click",
"image": "optional-image.jpg",
"price": "Optional Price",
"description": "Optional Description"
}
]
}
}
$( .ui.search' )
.search({
type : 'category',
minCharacters : 1,
source : { results : source },
});
Hello. Tried everything. Does not work. Seems broken. Any help, please?
Hey, can you add the code into a jsfiddle?
Sure. Here it is.
http://jsbin.com/pudugokipe/edit?html,js,output
Hi @Wandalen,
Thank you for posting, but although it’s a valid usage question, we’ve limited GitHub Issues to bug reports and feature requests, keeping the board more manageable for maintainers; see the contributing guidelines for more information on what kind of posts should find themselves into the GitHub Issues board.
To get answers or feedback that might allow you to repost this issue, please use one of our other support resources:
Hey, @Banandrew, @jlukic . It's an issue, not a question. That feature does not work. If it had solution I would found it. Resources you advised didn't help me.
@Wandalen I’ll take a closer look at it tomorrow and get back to you.
@Banandrew, it seems "source" option work only for .category and does not for .category.search. I believe it's an issue if only it was intentionally designed so. Thanks in advance.
@Wandalen You’re right, sorry about that. Local object search can only display standard search results (not categories), and it’s mentioned in the documentation—see the “Local Object” paragraph. Although, turns out that the issue is a duplicate of #3563 that was labeled as “Fix/Change Declined”. ¯\_(ツ)_/¯
Ok, so. Thanks @Banandrew
Maybe is not what you intended, just playing around:
$( '.ui.search' )
.search({
type : 'category',
minCharacters : 1,
source : source,
searchFields : [
'name'
]
});