easyui的combobox的focus和keydown事件


 /* ------ 處理 Spec 列輸入事件 begin --------- */
        var editor = table.datagrid('getEditor', { index: rowIndex, field: "Spec" });
        var target = editor.target;

        $(target).unbind("keydown");
        $(target).keydown(function (e) {
            if (e.keyCode == 13) {//如果是回車,將焦點移到數量輸入列
                table.datagrid('getEditor', { index: rowIndex, field: "UnitName" }).target.combobox('textbox').focus();
            }
        });
        /* ------ 處理 Spec 列輸入事件 end ------ */


        /* ------ 處理 UnitName 列輸入事件 begin --------- */
        var editor = table.datagrid('getEditor', { index: rowIndex, field: "UnitName" });
        var target = editor.target.combobox('textbox');

        $(target).unbind("keydown");
        $(target).keydown(function (event) {
            if (event.keyCode == 13) {
                table.datagrid('getEditor', { index: rowIndex, field: "Quantity" }).target.focus().select();
            }
        });
        /* ------ 處理 UnitName 列輸入事件 end ------ */

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2024 CODEPRJ.COM