easyui combobox设置默认值 获取text

来源:互联网 发布:天津软件行业协会 编辑:程序博客网 时间:2024/05/14 04:41

$('#xxx').combobox('setValue',11);


 $('#epsId_combo').combobox('selectedIndex',0);  



  1. <pre class="html" name="code"><select id='xxx' class="easyui-combobox" style="width: 180px;">  
  2.                  <option value='1'>第一个</option>  
  3.                   <option value='2' selected="selected">第二个</option>  
  4.                    <option value='3'>第三个</option>  
  5.                  </select>

如果设置有问题可以这样:在onLoadSuccess函数中执行

   $('#belongs').combobox({
        url : 'opr/book/combobox.do',
        valueField : 'id',
        textField : 'name',
        width : '140',
        height : '29',
        editable : false,
        panelHeight : 'auto',
        onLoadSuccess : function(data) {
            $('#belongs').combobox('setValue', b1);
        }
    });



获取text:

$('#com').combobox('getValue')获取当前选中的值$('#com').combobox('getText')获取当前选中的文字


0 0
原创粉丝点击