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 ------ */

  

原文地址:https://www.cnblogs.com/tooy/p/7825471.html