Skip to content

Instantly share code, notes, and snippets.

@YeomanYe
Created December 23, 2016 14:26
Show Gist options
  • Save YeomanYe/463ec1c6b8f93d13b48e56159938c9fe to your computer and use it in GitHub Desktop.
Save YeomanYe/463ec1c6b8f93d13b48e56159938c9fe to your computer and use it in GitHub Desktop.
EasyUI:dynamicCombobox
/**
* 动态生成combobox,获取后端传来的json数据
* @param {string} comboboxId combobox的ID
* @param {string} url url
* @param {string} value combobox的value对应的属性名
* @param {string} text combobobx的显示文本对应的属性名
*/
function dynamicCombobox(comboboxId,url,value,text){
$("#"+comboboxId).combobox({
valueField:value,
textField:text,
url:url,
editable:false
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment