JQuery EasyUI combobox动态添加option

海欣海夜 2015-03-20

<inputclass="easyui-combobox"id="rwlb"name="rwlb"style="width:435px"data-options="valueField:'id',textField:'text',panelHeight:'auto'">

方法一:

1vardata,json;

2json='[{"id":"年计划","text":"年计划","selected":true}]';

3data=$.parseJSON(json);

4$("#rwlb").combobox("loadData",data);

方法二:

1vardata,json;

2data=[];

3data.push({"text":"测试","id":100});

4$("#rwlb").combobox("loadData",data);

http://www.cnblogs.com/easypass/archive/2012/12/29/2838329.html

相关推荐