There is a need to dynamically add options to the ComboBox, and later the solution is as follows
HTML as follows
<id= "Workerlist"></Select>
JS as follows
Keyarray for an array of tips: Here foreach is not supported, Firefox online has a correction to this method is now directly affixed to the code, you can check their own
if(!Array.prototype.forEach) {Array.prototype.forEach=function(callback, Thisarg) {varT, K; if( This==NULL) { Throw NewTypeError ("This is a null or not defined"); } varO = Object ( This); varLen = o.length >>> 0;//Hack to convert O.length to a UInt32 if({}.tostring.call (callback)! = "[Object Function]") { Throw NewTypeError (callback + "is not a function"); } if(thisarg) {T=Thisarg; } k= 0; while(K <Len) { varKvalue; if(kinchO) {Kvalue=O[k]; Callback.call (T, Kvalue, K, O); } k++; } }; }
Keyarray.foreach (function(x) { $ ("#workerList"). Append ("<option value=\" "+x+" \ ">" +x+ "</option>"); }) $ ("#workerList"). ComboBox ( { editable:false,
Panelheight: ' Auto ', onSelect:function(param) { selectchange (param) } });
Easyui ComboBox Dynamic Add Selection