一、前台頁面:
<input id="List" class="easyui-combobox" data-options="valueField:'ID',textField:'NAME'" style="width: 170px;height:25px;"/>
二、JS代碼:
$.ajax({
url:baseCtx+"/actions/getListInfo.action",//獲取數據庫中包含ID和NAME字段的列表數據
type : 'post',
async : true,
dataType : "json",
success: function(data){ //data中有關於ID 和NAME字段的json數據
//debugger;
//調用combobox的loadData的方法加載數據
$('#List').combobox('loadData',data);
}
});
三、后台JAVA類
不做介紹了。同前面博客中action-bpo-mapper-xml中的寫法。