最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Set default selection to Magic suggest - Stack Overflow

programmeradmin2浏览0评论

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.

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.

Share Improve this question edited Jan 2, 2014 at 7:12 Iti Tyagi 3,6818 gold badges51 silver badges80 bronze badges asked Jan 2, 2014 at 7:04 narennaren 871 silver badge10 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 11

Use the 'value' option:

$('#ms-gmail').magicSuggest({
    resultAsString: true,
    width: 590,
    value: ['[email protected]'],
    data: '[email protected], [email protected],...,[email protected]'
});

The above example sets the default selected value to '[email protected]'

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

发布评论

评论列表(0)

  1. 暂无评论