Create a custom Smart Select

I want to create a custom smart select that populates virtual list from data that loads after hitting a API.

I’m not able to understand how to populate data in smart select. Kindly help

I’ve tried this until now:

                        function (data, status) {
                            var data = JSON.parse(data);
                            if (data.code == 1 && data.message == "success") {
                                modelnames =;

                            if (modelnames.length !== 0) {
                                smartSelect = app.smartSelect.create({
                                    el: $$('#add-smartsel > a'),
                                    virtualList: true,
                                    closeOnSelect: true,
                                    renderItems: function(items) {
                        function (error, xhr) {

Why do you pass renderItems parameter? Just add generated <option>...</option> elements inside Smart Select’s <select> element