3

I have a Magic suggest box in my application. For that I want to set default selected values. I have JSON object as well to bind the data. But I didn't find any option like how to make them selected.

Is there any option in Magic suggest?

Please let me know. Any help would be appreciated.

Incredible
  • 3,495
  • 8
  • 49
  • 77
naren
  • 87
  • 1
  • 10

1 Answers1

11

Use the 'value' option:

$('#ms-gmail').magicSuggest({
    resultAsString: true,
    width: 590,
    value: ['john@kennedy.com'],
    data: 'marilyn@monroe.com, mother@teresa.com,...,jimmy@wales.com'
});

The above example sets the default selected value to 'john@kennedy.com'

See http://nicolasbize.github.io/magicsuggest/

johnnycardy
  • 3,049
  • 1
  • 17
  • 27