質問

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.

役に立ちましたか?

解決

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/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top