解決juqery easyui combobox只能選擇問題

來源:互聯網
上載者:User

標籤:io   ar   sp   on   資料   art   問題   bs   cti   

1.首先設定框為 combobox樣式,該欄位值為了進行值的顯示

<tr class="odd_row">                <td class="TableLabel_Left">檢查人員</td>                <td class="TableText_Left" colspan="3">                    <ww:select name="jcry" id="jcry" theme="simple" list=‘dict_zzry‘ listKey="key"                               listValue="value" multiple=‘true‘ />                </td>            </tr>

2.增加對應儲存欄位

<ww:hidden name="tpzJcjl.jcry" id="tpzJcjl_jcry" />
 
3.值變化及回顯處理(針對下拉多選)
function getCombox(xsid,ycid){        $(‘#‘+xsid).combobox({            width: fixWidth(),  //設定寬度            editable:false,  //不能編輯            onChange: function () {   //選擇值的時候將值放入到需要儲存欄位                $("#"+ycid).val(‘‘);                var jcry = $(‘#‘+xsid).combobox(‘getValues‘);                $("#"+ycid).val(jcry);            },            onLoadSuccess: function () { //資料載入完畢事件,預設之前已經選中的值                if($("#"+ycid).val() != ‘‘){                    $(‘#‘+xsid).combobox(‘setValues‘,$("#"+ycid).val().split(‘,‘));  //將多選框值切割放入                }            }        });        $("#"+xsid).parent().find("input[class^=‘combo-text‘]").css("background", "#FFFFFF"); //修改背景色    } function fixWidth() {        return document.body.clientWidth * 0.33;    }


調用:
getCombox(‘jcry‘,‘tpzJcjl_jcry‘);
 

解決juqery easyui combobox只能選擇問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.