ext MultiSelect 动态添加,

var res = [{brushCardTime: ['9:09-14:29', '9:09-15:29', '9:09-16:29']];

 

            var result = res.detail[0].brushCardTime;

            var item = [] ;
            var itemObj ;
            var record;

            MultiSelect.store.removeAll();

            for (var i = 0; i < result.length; i++) {

                item = result[i];

                itemObj = new Object();

                itemObj.text = item;
// TODO, 如果是[ ['',''],['',''],['','']]形式,既value,text形式
//                itemObj.value = item[0];
//
//                itemObj.text = item[1];

                record = new Ext.data.Record(itemObj);

                MultiSelect.store.add(record);
            }

你可能感兴趣的:(ext)