easyui-combobox绑定回车事件注意事项


回车事件的定义的位置必须是easyui-combobox数据加载的后面,才有效果。

 

HTML文件:

<select id="aucBrandNo" class="easyui-combobox"  name="aucBrandNo" style="width: 160px;"
     data-options="required:true,onHidePanel:function(){validateComboboxInputValue(this)}">
   </select>

 

 

JS文件定义回车事件:

//combobx数据的加载
function
auctionSelect(aucBrandNos,aucBrandNo) { var aucBrandNoStr = ''; $.each(aucBrandNos, function(index, temp) { aucBrandNoStr += '<option value=' + temp.key + '>' + temp.name.substring(1,4) + temp.name.substring(0,1) + '</option>'; }); $('#aucBrandNo').html(aucBrandNoStr); $('#aucBrandNo').combobox({}); $('#aucBrandNo').combobox('setValue', aucBrandNo); keyDownEventFun();//回车事件公共方法 };

 

 

function keyDownEventFun(){
    $('#aucBrandNo').textbox('textbox').keydown(function (event) {
        if (event.keyCode == 13) {
            //TODO
        }
    });

}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM