Search Results in Semantic UI Search

1,281 views
Skip to first unread message

Frank Jaworski

unread,
Jan 12, 2015, 4:34:32 PM1/12/15
to seman...@googlegroups.com
Hello, 

How do I get search results to show?

$('#treatmentInput').search({type:'standard', minCharacters:2, maxResults:20, debug:true, source:content, searchFields:'name', searchFullText:false, onResults:function(response) {console.log(response);}, onSelect: function(value, text) {console.log(value);}});

I cannot tell from the documentation.  Thanks.


Jack Lukic

unread,
Jan 12, 2015, 4:52:55 PM1/12/15
to Frank Jaworski, seman...@googlegroups.com
Events are attached on input value property change. They should appear as you type

If they are not appearing, can you create a JSFiddle to show your issue.

--
You received this message because you are subscribed to the Google Groups "Semantic UI" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semantic-ui...@googlegroups.com.
To post to this group, send email to seman...@googlegroups.com.
Visit this group at http://groups.google.com/group/semantic-ui.
For more options, visit https://groups.google.com/d/optout.

Frank Jaworski

unread,
Jan 12, 2015, 4:55:57 PM1/12/15
to seman...@googlegroups.com, fdjphoe...@gmail.com
I am using Meteor.  Results appear but the content is empty, save for when nothing matches.  I don't know how to format the result content.  If that does not explain my issue more clearly, I will make a fiddle tomorrow.

Frank Jaworski

unread,
Jan 13, 2015, 9:07:58 AM1/13/15
to seman...@googlegroups.com
I cannot post a fiddle because Meteor is not a choice.  Is there a good, full example of the search concept?  What am I not doing?

Serkan Durusoy

unread,
Jan 13, 2015, 9:58:37 AM1/13/15
to seman...@googlegroups.com
The search module makes extensive use of the api behaviour which is a request/response type context while meteor has a reactive paradigm.

Therefore, until a tighter meteor/semantic integration (including api) gets done, you can make use of the local search feature as documented.

You will then need to catch the keyboard events using Template.searchTemplate.events({}) and update the content array reactively.

For testing that and perhaps getting help from Jack and others, you can use http://meteorpad.com which is basically jsfiddle for meteor.

$('.ui.search')
  .search({
    source: content
  })
;
var content = [
  { title: 'Andorrs' },
  { title: 'United Arab Emirates' },
  { title: 'Afghanistas' },
  { title: 'Antigus' },
  { title: 'Anguills' },
  { title: 'Albanis' },
  { title: 'Armenis' },
  { title: 'Netherlands Antilles' },
  { title: 'Angols' },
  { title: 'Argentins' },
  { title: 'American Samos' },
  { title: 'Austris' },
  { title: 'Australis' },
  { title: 'Arubs' },
  { title: 'Aland Islands' },
  { title: 'Azerbaijas' },
  { title: 'Bosnis' }
  // etc 
]; 

Sivli Kestanous

unread,
Jan 14, 2015, 11:12:02 AM1/14/15
to seman...@googlegroups.com
Frank,


Depending on your needs you may not even want to use the search module. I you do however, Serkan is correct, reload the array into the model reactively.

Sivli K.

Frank Jaworski

unread,
Jan 15, 2015, 7:58:58 AM1/15/15
to seman...@googlegroups.com
Thanks for the replies.  This was for a quick prototype.  For our actual application(s), we will either use the Semantic UI search feature in a more sophisticated way, or find a different Meteor package, maybe create our own.  I fixed the issue with my code by looking at the source.  Thanks again!

Domantas Garsva

unread,
Mar 12, 2015, 5:04:27 PM3/12/15
to seman...@googlegroups.com
Could you share the source code of your working search? Thanks.
Reply all
Reply to author
Forward
0 new messages