Add support for Esc key in editable tree
This commit is contained in:
1 parent
e03fa5ccb9
commit
4d475201e0
2 files changed
+11
-1
No files matched your search
@@ -8,6 +8,7 @@
|
||||
Sao.common.BACKSPACE_KEYCODE = 8;
|
||||
Sao.common.TAB_KEYCODE = 9;
|
||||
Sao.common.RETURN_KEYCODE = 13;
|
||||
Sao.common.ESC_KEYCODE = 27;
|
||||
Sao.common.UP_KEYCODE = 38;
|
||||
Sao.common.DOWN_KEYCODE = 40;
|
||||
Sao.common.DELETE_KEYCODE = 46;
|
||||
|
||||
+10
-1
@@ -881,7 +881,8 @@
|
||||
this.key_press.bind(this));
|
||||
if ((event_.which != Sao.common.TAB_KEYCODE) &&
|
||||
(event_.which != Sao.common.UP_KEYCODE) &&
|
||||
(event_.which != Sao.common.DOWN_KEYCODE)) {
|
||||
(event_.which != Sao.common.DOWN_KEYCODE) &&
|
||||
(event_.which != Sao.common.ESC_KEYCODE)) {
|
||||
return;
|
||||
}
|
||||
var column = this.tree.columns[this.edited_column];
|
||||
@@ -946,6 +947,14 @@
|
||||
.trigger('click').trigger('click');
|
||||
}.bind(this), 0);
|
||||
}.bind(this));
|
||||
} else if (event_.which == Sao.common.ESC_KEYCODE) {
|
||||
this.get_widget().show();
|
||||
this.get_widget_editable().hide();
|
||||
current_td = this.get_active_td();
|
||||
current_td.one('click',
|
||||
{column: this.edited_column, td: current_td},
|
||||
this.select_row.bind(this));
|
||||
this.edited_column = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user