Semantic-UI icon indicating copy to clipboard operation
Semantic-UI copied to clipboard

Search category mode broken?

Open Wandalen opened this issue 10 years ago • 9 comments

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?

Wandalen avatar Oct 14 '16 08:10 Wandalen

Hey, can you add the code into a jsfiddle?

IonutBajescu avatar Oct 19 '16 10:10 IonutBajescu

Sure. Here it is.

http://jsbin.com/pudugokipe/edit?html,js,output

Wandalen avatar Oct 19 '16 11:10 Wandalen

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:

awgv avatar Feb 06 '17 01:02 awgv

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 avatar Feb 06 '17 03:02 Wandalen

@Wandalen I’ll take a closer look at it tomorrow and get back to you.

awgv avatar Feb 06 '17 03:02 awgv

@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 avatar Feb 06 '17 03:02 Wandalen

@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”. ¯\_(ツ)_/¯

awgv avatar Feb 08 '17 03:02 awgv

Ok, so. Thanks @Banandrew

Wandalen avatar Feb 08 '17 17:02 Wandalen

Maybe is not what you intended, just playing around:

$( '.ui.search' ) .search({ type : 'category', minCharacters : 1, source : source, searchFields : [ 'name' ] });

llturro avatar Feb 08 '17 17:02 llturro