3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
16 * @class Ext.grid.CellEditor
18 * Internal utility class that provides default configuration for cell editing.
21 Ext.define('Ext.grid.CellEditor', {
23 constructor: function(config) {
24 config = Ext.apply({}, config);
27 config.field.monitorTab = false;
29 if (!Ext.isDefined(config.autoSize)) {
34 this.callParent([config]);
39 * Hide the grid cell when editor is shown.
42 var first = this.boundEl.first();
46 this.callParent(arguments);
51 * Show grid cell when editor is hidden.
54 var first = this.boundEl.first();
58 this.callParent(arguments);
63 * Fix checkbox blur when it is clicked.
65 afterRender: function() {
66 this.callParent(arguments);
67 var field = this.field;
68 if (field.isXType('checkboxfield')) {
69 field.mon(field.inputEl, 'mousedown', this.onCheckBoxMouseDown, this);
70 field.mon(field.inputEl, 'click', this.onCheckBoxClick, this);
76 * Because when checkbox is clicked it loses focus completeEdit is bypassed.
78 onCheckBoxMouseDown: function() {
79 this.completeEdit = Ext.emptyFn;
84 * Restore checkbox focus and completeEdit method.
86 onCheckBoxClick: function() {
87 delete this.completeEdit;
88 this.field.focus(false, 10);
93 cls: Ext.baseCSSPrefix + "small-editor " + Ext.baseCSSPrefix + "grid-editor",