4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-grid-CellEditor'>/**
19 </span> * @class Ext.grid.CellEditor
21 * Internal utility class that provides default configuration for cell editing.
24 Ext.define('Ext.grid.CellEditor', {
26 constructor: function(config) {
27 config = Ext.apply({}, config);
30 config.field.monitorTab = false;
32 if (!Ext.isDefined(config.autoSize)) {
37 this.callParent([config]);
40 <span id='Ext-grid-CellEditor-method-onShow'> /**
42 * Hide the grid cell when editor is shown.
45 var first = this.boundEl.first();
49 this.callParent(arguments);
52 <span id='Ext-grid-CellEditor-method-onHide'> /**
54 * Show grid cell when editor is hidden.
57 var first = this.boundEl.first();
61 this.callParent(arguments);
64 <span id='Ext-grid-CellEditor-method-afterRender'> /**
66 * Fix checkbox blur when it is clicked.
68 afterRender: function() {
69 this.callParent(arguments);
70 var field = this.field;
71 if (field.isXType('checkboxfield')) {
72 field.mon(field.inputEl, 'mousedown', this.onCheckBoxMouseDown, this);
73 field.mon(field.inputEl, 'click', this.onCheckBoxClick, this);
77 <span id='Ext-grid-CellEditor-method-onCheckBoxMouseDown'> /**
79 * Because when checkbox is clicked it loses focus completeEdit is bypassed.
81 onCheckBoxMouseDown: function() {
82 this.completeEdit = Ext.emptyFn;
85 <span id='Ext-grid-CellEditor-method-onCheckBoxClick'> /**
87 * Restore checkbox focus and completeEdit method.
89 onCheckBoxClick: function() {
90 delete this.completeEdit;
91 this.field.focus(false, 10);
94 alignment: "tl-tl",
96 cls: Ext.baseCSSPrefix + "small-editor " + Ext.baseCSSPrefix + "grid-editor",