JQuery EasyUI combobox动态添加option

时间:2023-01-07 17:34:05
<input class="easyui-combobox" id="rwlb" name="rwlb" style="width:435px" data-options="valueField:'id', textField:'text', panelHeight:'auto'" >  

方法一:

var data, json;
json = '[{"id":"年计划","text":"年计划","selected":true}]';
data = $.parseJSON(json);
$("#rwlb").combobox("loadData", data);

方法二:

var data,json;
data = [];
data.push({ "text": "测试", "id": });
$("#rwlb").combobox("loadData", data);