This is in the OA system, need to use a small function, more general, because I was only contact Easyui soon, I hope the wrong place everyone point out, thank you
Easyui-combobox for Interface
<td><label for= "lab_con_id" > Service contract number:</label></td>
<td><input class= "Easyui-combobox" data-options= "Required:false" name= "lab_con_id" id= "lab_con_id" > </td>
Js
$ (function () {
Go to the background, query out the data, bind the data
Ajaxhelper ('/labcontract/select_conid ', ' GET ', null). Done (the function (DT) {
$ (' #lab_con_id '). Combox ({
DATA:DT;
Valuefield: ' Id ',
TextField: ' con_id '
})
});
})
Controller
Public Jsonresult Select_conid () {
Method of finding
List<contract> conlist=_ilabconttact. Getcontractid () as list<contract>;
Assigning values to the model pass to the interface
List<contractviewmodel> vm=new list<contractviewmodel> ();
Conlist. ForEach (item=>{
List<contractviewmodel> vmodel=new list<contractviewmodel> ();
Vmodel. Id=item. Id;
Vmodel. Con_id=item. con_id;
Vm. ADD (Vmodel);
})
Return Json{vm,jsonrequestbehavior.allowget}
}
JQuery Easyui binding Drop Box control get data from Database MVC controller pass the value past