自动补全 Autocomplete

HTML代码

<div class="form-group">
            <label for="exampleInputEmail1">Product List</label>
            <input id="autoComplete" type="text" class="form-control w400" placeholder="请输入产品名">
        </div>

javascript代码

require('../../widgets/autocomplete/module');
        var datas = [
            {
                name: 'HYPER Advertiser',
                value: 1
            }, {
                name: 'HYPER Web Analytics',
                value: 2
            }, {
                name: 'HYPER Mobile Analytics',
                value: 3
            }, {
                name: 'HYPER Video Analytics',
                value: 4
            }, {
                name: 'HYPER DMP',
                value: 5
            }, {
                name: 'HYPER Ad Serving',
                value: 6
            }, {
                name: 'HYPER Data Discovery',
                value: 7
            }
        ];
        var input = $('#autoComplete');
        var autoComplete = $p.autoComplete(input, {
            datas: datas,
            autoShowPanel: true,
            chooseCallback: function (data) {
                input.val(data.data.name);
            }
        });