前言
小编今天没事看看笔记,突然看到了一个项目中很常用的知识点——动态给easyui-combobox添加option,现在分享出来给大家!
实例
本项目使用的是easyui-combobox,下拉框中的内容是动态的从数据库中查出来的,然后要在下拉内容中添加一个全部。
html
<span style="font-size:18px;"><input id="RewardObject" class="easyui-combobox" name="RewardObject"
data-options="onSelect:function(){ SelectRewardByRewardName();},valueField:'id', textField:'text',editable:false,onBeforeLoad:function(){LoadRewardObject();}"/></font> </span>