标签:easyui easyui-combobox 动态添加
根据后台数据添加:
$("#themecombo").combobox({ url:'<%=basePath%>analysis/getactivit.action', valueField:'id', textField:'title', editable:false });
$(document).ready( function(){ $.ajax({ url:'<%=basePath%>analysis/getactivit.action', type:'post', success:function(data){ var themecombo2 =[{ 'text':'请选择','id':''}]; for(var i=0;i<data.length;i++){ themecombo2.push({"text":data[i].title,"id":data[i].id}); } $("#themecombo").combobox("loadData", themecombo2); } }); });
<td class="label" id="lthemecombo">主题: </td> <td class="content" id="lthemecomboi"> <input id="themecombo" class="easyui-combobox" name="prefecture" style="width:160px;" data-options="editable:false,valueField:'id', textField:'text'" /> </td>
标签:easyui easyui-combobox 动态添加
原文地址:http://blog.csdn.net/zhao50632/article/details/44018523