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