Set default selection to Magic suggest

javascript, magicsuggest

Solution

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/

Problem

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.

Original source