gridx-rails 1.1.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +3 -3
  3. data/app/assets/javascripts/gridx/Grid.js +3 -2
  4. data/app/assets/javascripts/gridx/core/model/cache/_Cache.js +25 -8
  5. data/app/assets/javascripts/gridx/modules/Bar.js +1 -2
  6. data/app/assets/javascripts/gridx/modules/Body.js +15 -7
  7. data/app/assets/javascripts/gridx/modules/CellWidget.js +8 -4
  8. data/app/assets/javascripts/gridx/modules/ColumnLock.js +12 -12
  9. data/app/assets/javascripts/gridx/modules/ColumnResizer.js +9 -10
  10. data/app/assets/javascripts/gridx/modules/Dod.js +1 -0
  11. data/app/assets/javascripts/gridx/modules/Edit.js +18 -15
  12. data/app/assets/javascripts/gridx/modules/Filter.js +7 -3
  13. data/app/assets/javascripts/gridx/modules/Focus.js +45 -36
  14. data/app/assets/javascripts/gridx/modules/GroupHeader.js +2 -1
  15. data/app/assets/javascripts/gridx/modules/HLayout.js +1 -0
  16. data/app/assets/javascripts/gridx/modules/HScroller.js +1 -0
  17. data/app/assets/javascripts/gridx/modules/Header.js +8 -1
  18. data/app/assets/javascripts/gridx/modules/HeaderMenu.js +1 -0
  19. data/app/assets/javascripts/gridx/modules/HeaderRegions.js +2 -1
  20. data/app/assets/javascripts/gridx/modules/IndirectSelect.js +7 -34
  21. data/app/assets/javascripts/gridx/modules/IndirectSelectColumn.js +4 -13
  22. data/app/assets/javascripts/gridx/modules/Menu.js +5 -1
  23. data/app/assets/javascripts/gridx/modules/NavigableCell.js +3 -1
  24. data/app/assets/javascripts/gridx/modules/NestedSort.js +4 -1
  25. data/app/assets/javascripts/gridx/modules/Pagination.js +1 -0
  26. data/app/assets/javascripts/gridx/modules/Persist.js +1 -0
  27. data/app/assets/javascripts/gridx/modules/RowHeader.js +11 -10
  28. data/app/assets/javascripts/gridx/modules/SingleSort.js +1 -0
  29. data/app/assets/javascripts/gridx/modules/SummaryBar.js +1 -0
  30. data/app/assets/javascripts/gridx/modules/ToolBar.js +3 -0
  31. data/app/assets/javascripts/gridx/modules/TouchScroll.js +1 -0
  32. data/app/assets/javascripts/gridx/modules/TouchVScroller.js +28 -5
  33. data/app/assets/javascripts/gridx/modules/Traverse.js +1 -0
  34. data/app/assets/javascripts/gridx/modules/Tree.js +2 -1
  35. data/app/assets/javascripts/gridx/modules/VLayout.js +1 -0
  36. data/app/assets/javascripts/gridx/modules/VScroller.js +22 -11
  37. data/app/assets/javascripts/gridx/modules/View.js +11 -6
  38. data/app/assets/javascripts/gridx/modules/VirtualVScroller.js +8 -4
  39. data/app/assets/javascripts/gridx/modules/dnd/Column.js +3 -4
  40. data/app/assets/javascripts/gridx/modules/dnd/Row.js +3 -4
  41. data/app/assets/javascripts/gridx/modules/dnd/_Dnd.js +1 -0
  42. data/app/assets/javascripts/gridx/modules/extendedSelect/Cell.js +4 -3
  43. data/app/assets/javascripts/gridx/modules/extendedSelect/Column.js +6 -7
  44. data/app/assets/javascripts/gridx/modules/extendedSelect/Row.js +33 -15
  45. data/app/assets/javascripts/gridx/modules/filter/FilterBar.js +9 -7
  46. data/app/assets/javascripts/gridx/modules/filter/FilterDialog.js +1 -1
  47. data/app/assets/javascripts/gridx/modules/filter/FilterPane.js +1 -1
  48. data/app/assets/javascripts/gridx/modules/filter/QuickFilter.js +1 -0
  49. data/app/assets/javascripts/gridx/modules/move/Column.js +2 -1
  50. data/app/assets/javascripts/gridx/modules/move/Row.js +2 -1
  51. data/app/assets/javascripts/gridx/modules/pagination/PaginationBar.js +1 -0
  52. data/app/assets/javascripts/gridx/modules/pagination/PaginationBarDD.js +2 -0
  53. data/app/assets/javascripts/gridx/modules/select/Cell.js +10 -7
  54. data/app/assets/javascripts/gridx/modules/select/Column.js +3 -2
  55. data/app/assets/javascripts/gridx/modules/select/Row.js +27 -13
  56. data/app/assets/javascripts/gridx/support/QuickFilter.js +7 -2
  57. data/lib/gridx-rails/version.rb +1 -1
  58. data/test/dummy/log/test.log +5 -0
  59. metadata +2 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDkxNzQxZWUyZWNmZDI3ZjhjNDI4Yjc4M2YwN2FkNDRiMmUyMWFmMQ==
4
+ NzkzMDJiMGUwN2VhZWYwYTE0NzVhMzQ1YWEzY2I0ZDlhNzBjYWEyNQ==
5
5
  data.tar.gz: !binary |-
6
- ZjliNzU1YmNmYmJiY2I5YWI4ZjQ3ODM0ZDZiMzNkZDE1ODBhNjAwMQ==
6
+ NzVkMzJmMzkwMjcxOGFjMzg1ZTAyNjgwYzQ3ZWJlZWY5ZDc2OTY5Zg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OTM1ZjlhM2U5MmUwY2Y0OTJhZTk4M2U1NzFkNWJkNTczMDM2MTcyMTM4MTli
10
- ZDQ2ZDhjZTdjNDYwNGNmNzMyY2Q5ZWE1ZWQwNDMyNDcyM2Q1ZGFjODMzZDJh
11
- MjU3NDc5MjVjZGIxNmI1MmRjZjI2NDA0YWNhMTA4ZjI0Y2I1ZDE=
9
+ ZjhiNjRiMDZlYjZhODFiMGZiMTJiMDc0ODgwZmIxNWI0NjNlNmVmZDRiYTQw
10
+ ZTdlMDFjZmFmYjZlZmM0YjgzMGJhMGQzNjJlMzI4OWUwNGEzNmZkMzBjMTg3
11
+ NTNiYzU4NjQxN2M2MDdmYzYwNDVlZTdhYTEyN2U4OTU4ZTk3ZjY=
12
12
  data.tar.gz: !binary |-
13
- YzRlNDcyYzNlZWVhYjg0MWZiMzc2NTMyOGI2ZGY0ZWQ2NGVmMzM0ZjI2OThi
14
- MjY4MTYyZTFhZThkMDQ3ZDg0NjdkZTBiM2YxMjA0MDRkODUwNGY5ZjI5NjBl
15
- MzFmYmNkNDU0YmNhODYxNzgwZmU2ZDdkZWZiYmJmMmIyZjU0YWM=
13
+ MDk4NWE1ZmU2YjM2ZWM0ZjQ4ZDcwYzY0MTM0ZWNkZTYyOTU1NGYzMGQyZWE0
14
+ OTI2NzlkNjAyODQ2ZmVkMjU2NjcyZDY3ZWZkNDA4YzBiMWVhYWMzMzMzMzBi
15
+ YTM0ZDgwNmJkYTY5ZmRjNmI3ODE5YmIwN2U4NzNlY2VjNmU3ZTk=
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # gridx-rails
2
2
 
3
- This gem packages [GridX](http://oria.github.io/gridx/) 1.1.0 assets (JavaScripts, stylesheets,
3
+ This gem prepares [GridX](http://oria.github.io/gridx/) assets (JavaScripts, stylesheets,
4
4
  templates and and images) for the Rails 3.1+ [asset
5
5
  pipeline](http://guides.rubyonrails.org/asset_pipeline.html).
6
6
 
7
7
  GridX is designed to load modules using Dojo AMD, so the files are not
8
- packaged together in the typical asset pipeline style, they are instead
9
- minified separately.
8
+ packaged together in a single file, in the typical asset pipeline style,
9
+ they are instead precompiled separately.
10
10
 
11
11
  ## Usage
12
12
 
@@ -180,7 +180,8 @@ define([
180
180
  _compNames: ['Cell', 'HeaderCell', 'Row', 'Header'],
181
181
 
182
182
  _eventNames: [
183
- 'Click', 'DblClick',
183
+ 'TouchStart', 'TouchEnd',
184
+ 'Click', 'DblClick',
184
185
  'MouseDown', 'MouseUp',
185
186
  'MouseOver', 'MouseOut',
186
187
  'MouseMove', 'ContextMenu',
@@ -214,7 +215,7 @@ define([
214
215
  },
215
216
  //event handling end
216
217
 
217
- _isCopyEvent: function(evt){
218
+ _isCtrlKey: function(evt){
218
219
  // summary:
219
220
  // On Mac Ctrl+click also opens a context menu. So call this to check ctrlKey instead of directly call evt.ctrlKey
220
221
  // if you need to implement some handler for Ctrl+click.
@@ -68,6 +68,7 @@ define([
68
68
  //virtual root node, with id ''.
69
69
  t._struct[''] = [];
70
70
  t._size[''] = -1;
71
+ t.totalSize = undefined;
71
72
  },
72
73
 
73
74
  byIndex: function(index, parentId){
@@ -163,7 +164,7 @@ define([
163
164
  c = t._cache[id];
164
165
  for(colId in columns){
165
166
  col = columns[colId];
166
- c.data[colId] = t._formatCell(col.id, c.rawData);
167
+ c.data[colId] = t._formatCell(c.rawData, id, col.id);
167
168
  }
168
169
  }
169
170
  },
@@ -181,15 +182,15 @@ define([
181
182
  return item;
182
183
  },
183
184
 
184
- _formatCell: function(colId, rawData){
185
+ _formatCell: function(rawData, rowId, colId){
185
186
  var col = this.columns[colId];
186
- return col.formatter ? col.formatter(rawData) : rawData[col.field || colId];
187
+ return col.formatter ? col.formatter(rawData, rowId) : rawData[col.field || colId];
187
188
  },
188
189
 
189
- _formatRow: function(rowData){
190
+ _formatRow: function(rowData, rowId){
190
191
  var cols = this.columns, res = {}, colId;
191
192
  for(colId in cols){
192
- res[colId] = this._formatCell(colId, rowData);
193
+ res[colId] = this._formatCell(rowData, rowId, colId);
193
194
  }
194
195
  return res;
195
196
  },
@@ -218,7 +219,7 @@ define([
218
219
  pr.push(id);
219
220
  }
220
221
  t._cache[id] = {
221
- data: t._formatRow(rowData),
222
+ data: t._formatRow(rowData, id),
222
223
  rawData: rowData,
223
224
  item: item
224
225
  };
@@ -244,6 +245,15 @@ define([
244
245
  t._size[parentId] = parseInt(size, 10);
245
246
  }
246
247
  function onComplete(items){
248
+ //FIXME: store does not support getting total size after filter/query, so we must change the protocal a little.
249
+ if(items.ioArgs && items.ioArgs.xhr){
250
+ var range = results.ioArgs.xhr.getResponseHeader("Content-Range");
251
+ if(range && (range = range.match(/(.+)\//))){
252
+ t.totalSize = +range[1];
253
+ }else{
254
+ t.totalSize = undefined;
255
+ }
256
+ }
247
257
  try{
248
258
  var start = options.start || 0,
249
259
  i = 0,
@@ -308,15 +318,19 @@ define([
308
318
  row = t._itemToObject(item),
309
319
  parentItem = parentInfo && parentInfo[s.fetch ? 'item' : 'parent'],
310
320
  parentId = parentItem ? s.getIdentity(parentItem) : '',
321
+ id = s.getIdentity(item),
311
322
  size = t._size[''];
312
323
  t.clear();
313
- t.onNew(s.getIdentity(item), 0, {
314
- data: t._formatRow(row),
324
+ t.onNew(id, 0, {
325
+ data: t._formatRow(row, id),
315
326
  rawData: row,
316
327
  item: item
317
328
  });
318
329
  if(!parentItem && size >= 0){
319
330
  t._size[''] = size + 1;
331
+ if(t.totalSize >= 0){
332
+ t.totalSize = size + 1;
333
+ }
320
334
  t.model._onSizeChange();
321
335
  }
322
336
  },
@@ -359,6 +373,9 @@ define([
359
373
  t.onDelete(id, index - 1, path);
360
374
  if(!parentId && size >= 0){
361
375
  sz[''] = size - 1;
376
+ if(t.totalSize >= 0){
377
+ t.totalSize = size - 1;
378
+ }
362
379
  t.model._onSizeChange();
363
380
  }
364
381
  }else{
@@ -11,9 +11,8 @@ define([
11
11
 
12
12
  /*=====
13
13
  var Bar = declare(_Module, {
14
- // module:
15
- // gridx/modules/Bar
16
14
  // summary:
15
+ // module name: bar.
17
16
  // This is a general-purpose bar for gridx.
18
17
  // description:
19
18
  // This module can be configured to hold various plugins, such as pager, pageSizer, gotoPageButton, summary, quickFilter, toobar, etc.
@@ -43,6 +43,7 @@ define([
43
43
 
44
44
  var Body = declare(_Module, {
45
45
  // summary:
46
+ // module name: body.
46
47
  // The body UI of grid.
47
48
  // description:
48
49
  // This module is in charge of row rendering. It should be compatible with virtual/non-virtual scroll,
@@ -250,7 +251,7 @@ define([
250
251
  query('> .gridxRowOver', t.domNode).removeClass('gridxRowOver');
251
252
  }
252
253
  });
253
- t.aspect(g, 'setStore', function(){
254
+ t.aspect(g.model, 'setStore', function(){
254
255
  t.refresh();
255
256
  });
256
257
  },
@@ -544,7 +545,10 @@ define([
544
545
  var scrollTop = isRefresh ? n.scrollTop : 0;
545
546
  n.scrollTop = 0;
546
547
  //unrender before destroy nodes, so that other modules have a chance to detach nodes.
547
- t.onUnrender();
548
+ if(!t._skipUnrender){
549
+ //only when we do have something to unrender
550
+ t.onUnrender();
551
+ }
548
552
  n.innerHTML = str;
549
553
  if(scrollTop){
550
554
  n.scrollTop = scrollTop;
@@ -565,7 +569,10 @@ define([
565
569
  }else if(!{top: 1, bottom: 1}[position]){
566
570
  n.scrollTop = 0;
567
571
  //unrender before destroy nodes, so that other modules have a chance to detach nodes.
568
- t.onUnrender();
572
+ if(!t._skipUnrender){
573
+ //only when we do have something to unrender
574
+ t.onUnrender();
575
+ }
569
576
  n.innerHTML = '';
570
577
  en.innerHTML = emptyInfo;
571
578
  en.style.zIndex = '';
@@ -919,16 +926,17 @@ define([
919
926
  });
920
927
  t.connect(g.mainNode, 'onkeydown', function(evt){
921
928
  if(focus.currentArea() == 'body'){
922
- var dk = keys;
923
- if(evt.keyCode == dk.HOME && !evt.ctrlKey){
929
+ var dk = keys,
930
+ ctrlKey = g._isCtrlKey(evt);
931
+ if(evt.keyCode == dk.HOME && !ctrlKey){
924
932
  t._focusCellCol = 0;
925
933
  t._focusCell();
926
934
  focus.stopEvent(evt);
927
- }else if(evt.keyCode == dk.END && !evt.ctrlKey){
935
+ }else if(evt.keyCode == dk.END && !ctrlKey){
928
936
  t._focusCellCol = g._columns.length - 1;
929
937
  t._focusCell();
930
938
  focus.stopEvent(evt);
931
- }else if(!g.tree || !evt.ctrlKey){
939
+ }else if(!g.tree || !ctrlKey){
932
940
  focus._noBlur = 1; //1 as true
933
941
  var arr = {}, dir = g.isLeftToRight() ? 1 : -1;
934
942
  arr[dk.LEFT_ARROW] = [0, -dir, evt];
@@ -25,6 +25,7 @@ define([
25
25
 
26
26
  var CellWidget = declare(_Module, {
27
27
  // summary:
28
+ // module name: cellWidget.
28
29
  // This module makes it possible to efficiently show widgets within a grid cell.
29
30
  // description:
30
31
  // Since widget declarations need to be parsed by dojo.parser, it can NOT be directly
@@ -110,6 +111,8 @@ define([
110
111
  // CellWidget module reuses widgets in cell, so if there is no widgets in cell, you don't need this module at all.
111
112
  widgetsInCell: false,
112
113
 
114
+ allowEventBubble: false,
115
+
113
116
  decorator: function(){
114
117
  // summary:
115
118
  // This decorator function is slightly different from the one when this module is not used.
@@ -203,13 +206,14 @@ define([
203
206
  },
204
207
 
205
208
  postCreate: function(){
206
- var dn = this.domNode;
207
- this.connect(dn, 'onmousedown', function(e){
208
- if(e.target != dn){
209
+ var t = this,
210
+ dn = t.domNode;
211
+ t.connect(dn, 'onmousedown', function(e){
212
+ if(e.target != dn && !t.cell.column.allowEventBubble){
209
213
  e.cancelBubble = true;
210
214
  }
211
215
  });
212
- this._cellCnnts = [];
216
+ t._cellCnnts = [];
213
217
  },
214
218
 
215
219
  startup: function(){
@@ -14,6 +14,7 @@ define([
14
14
  /*=====
15
15
  return declare(_Module, {
16
16
  // summary:
17
+ // module name: columnLock.
17
18
  // Column lock machinery.
18
19
  // description:
19
20
  // This module provides a way to lock consecutive leading columns.
@@ -64,15 +65,16 @@ define([
64
65
  _this.connect(g.body, 'onAfterRow', function(row){
65
66
  _this._lockColumns(row.node());
66
67
  });
67
-
68
- _this.connect(g.header, 'onRender', '_updateHeader');
69
68
  _this.connect(g.columnWidth, 'onUpdate', '_updateHeader');
70
- _this.connect(g, 'resize', '_updateUI');
69
+ _this.connect(g.header, 'onRender', '_updateHeader');
71
70
  if(g.columnResizer){
72
71
  //make it compatible with column resizer
73
72
  _this.connect(g.columnResizer, 'onResize', '_updateHeader');
74
73
  _this.connect(g.columnResizer, 'onResize', '_updateBody');
75
74
  }
75
+
76
+ _this.connect(g, '_onResizeEnd', '_updateHeader');
77
+ _this.connect(g, '_onResizeEnd', '_updateBody');
76
78
  if(g.header){
77
79
  g.header.loaded.then(function(){
78
80
  _this._updateHeader();
@@ -130,6 +132,7 @@ define([
130
132
  }
131
133
  rowNode.style[ltr ? 'paddingLeft' : 'paddingRight'] = '0px';
132
134
  rowNode.style.width = 'auto';
135
+ rowNode.firstChild.style.height = 'auto';
133
136
  },
134
137
 
135
138
  _updateUI: function(){
@@ -152,6 +155,7 @@ define([
152
155
  var isHeader = domClass.contains(rowNode, 'gridxHeaderRowInner');
153
156
  var ltr = this.grid.isLeftToRight();
154
157
  var r = rowNode.firstChild.rows[0], i;
158
+ rowNode.firstChild.style.height = 'auto'; //Remove the height of the last locked state.
155
159
  for(i = 0; i < this.count; i++){
156
160
  domStyle.set(r.cells[i], 'height', 'auto');
157
161
  }
@@ -159,17 +163,16 @@ define([
159
163
  var h1 = domGeometry.getContentBox(r.cells[r.cells.length - 1]).h,
160
164
  h2 = domGeometry.getMarginBox(r.cells[r.cells.length - 1]).h;
161
165
 
162
- if(has('ie') > 8){
166
+ if(has('ie') > 8){
163
167
  //in IE 9 +, sometimes computed height will contain decimal pixels like 34.4 px,
164
168
  //so that the locked cells will have different height with the unlocked ones.
165
169
  //plus the height by 1 can force IE to ceil the decimal to integer like from 34.4px to 35px
166
-
167
- h3 = domStyle.getComputedStyle(rowNode.firstChild).height;
170
+ var h3 = domStyle.getComputedStyle(rowNode.firstChild).height;
168
171
  if(String(h3).toString().indexOf('.') >= 0){ //decimal
169
172
  h2++;
170
173
  h1++;
171
174
  }
172
- }
175
+ }
173
176
  domStyle.set(rowNode.firstChild, 'height', h2 + 'px');
174
177
 
175
178
  var lead = isHeader ? this.grid.hLayout.lead : 0,
@@ -179,11 +182,8 @@ define([
179
182
  var cell = r.cells[i],
180
183
  s;
181
184
  domClass.add(cell, 'gridxLockedCell');
182
- // if(has('ie') > 8){
183
- // s = {height: h1 + 1 + 'px'};
184
- // }else{
185
- s = {height: h1 + 'px'};
186
- // }
185
+
186
+ s = {height: h1 + 'px'};
187
187
  s[ltr ? 'left' : 'right'] = pl + 'px';
188
188
  domStyle.set(cell, s);
189
189
 
@@ -9,10 +9,10 @@ define([
9
9
  "dojo/dom-geometry",
10
10
  "dojo/keys",
11
11
  "dojo/query",
12
- 'dojo/sniff',
12
+ "dojo/_base/sniff",
13
13
  "../core/_Module"
14
14
  // "dojo/NodeList-traverse"
15
- ], function(declare, win, event, dom, domStyle, domClass, domConstruct, domGeometry, keys, query, sniff, _Module){
15
+ ], function(declare, win, event, dom, domStyle, domClass, domConstruct, domGeometry, keys, query, has, _Module){
16
16
 
17
17
  /*=====
18
18
  Column.setWidth = function(width){
@@ -22,6 +22,7 @@ define([
22
22
 
23
23
  return declare(_Module, {
24
24
  // summary:
25
+ // module name: columnResizer.
25
26
  // Column Resizer machinery.
26
27
  // description:
27
28
  // This module provides a way to resize column width.
@@ -108,10 +109,8 @@ define([
108
109
  cs.maxWidth = width + 'px';
109
110
  });
110
111
  g.body.onRender();
112
+ g.hLayout.reLayout();
111
113
  g.vLayout.reLayout();
112
- if(g.autoWidth){
113
- g.hLayout.reLayout();
114
- }
115
114
  t.onResize(colId, width, oldWidth);
116
115
  }
117
116
  },
@@ -157,7 +156,7 @@ define([
157
156
  _mouseout: function(e){
158
157
  if(!this._resizing){
159
158
  var pos = domGeometry.position(this.grid.header.domNode);
160
- if(sniff('chrome')){
159
+ if(has('chrome')){
161
160
  for(var i in pos){
162
161
  pos[i] = Math.floor(pos[i]);
163
162
  }
@@ -262,11 +261,11 @@ define([
262
261
  },
263
262
 
264
263
  _keydown: function(evt){
264
+ var t = this,
265
+ g = t.grid;
265
266
  //support keyboard to resize a column
266
- if((evt.keyCode == keys.LEFT_ARROW || evt.keyCode == keys.RIGHT_ARROW) && evt.ctrlKey && evt.shiftKey){
267
- var t = this,
268
- g = t.grid,
269
- colId = evt.columnId,
267
+ if((evt.keyCode == keys.LEFT_ARROW || evt.keyCode == keys.RIGHT_ARROW) && g._isCtrlKey(evt) && evt.shiftKey){
268
+ var colId = evt.columnId,
270
269
  cellNode = query('[colid="' + g._escapeId(colId) + '"].gridxCell', g.header.innerNode)[0],
271
270
  step = t.arg('step');
272
271
  step = evt.keyCode == keys.LEFT_ARROW ^ !!g.isLeftToRight() ? step : -step;
@@ -17,6 +17,7 @@ define([
17
17
  /*=====
18
18
  return declare(_Module, {
19
19
  // summary:
20
+ // module name: dod.
20
21
  // Details on demand.
21
22
 
22
23
  // useAnimation: Boolean
@@ -415,7 +415,12 @@ define([
415
415
  t.connect(g.body, 'onAfterCell', _onAftercell);
416
416
  }
417
417
  g.domNode.removeAttribute('aria-readonly');
418
- t.connect(g, 'onCellDblClick', '_onUIBegin');
418
+ t.connect(g, 'onCellDblClick', function(evt){
419
+ if(!domClass.contains(evt.target, 'gridxTreeExpandoIcon') &&
420
+ !domClass.contains(evt.target, 'gridxTreeExpandoInner')){
421
+ t._onUIBegin(evt);
422
+ }
423
+ });
419
424
  t.connect(g.cellWidget, 'onCellWidgetCreated', '_onCellWidgetCreated');
420
425
  t.connect(g.cellWidget, 'initializeCellWidget', function(widget, cell){
421
426
  var column = cell.column;
@@ -774,7 +779,10 @@ define([
774
779
  var delay = column.editorArgs && column.editorArgs.applyDelay || 500;
775
780
  clearTimeout(editor._timeoutApply);
776
781
  editor._timeoutApply = setTimeout(function(){
777
- t.apply(rn.getAttribute('rowid'), column.id);
782
+ var rowId = rn.getAttribute('rowid');
783
+ t.apply(rowId, column.id).then(function(){
784
+ t._focusEditor(rowId, column.id);
785
+ });
778
786
  }, delay);
779
787
  }
780
788
  });
@@ -965,19 +973,14 @@ define([
965
973
  this._editing = false;
966
974
  var focus = this.grid.focus;
967
975
  if(focus){
968
- if(has('ie')){
969
- setTimeout(function(){
970
- focus.focusArea('body');
971
- }, 1);
972
- }else{
973
- focus.focusArea('body');
974
- }
976
+ focus.focusArea('body');
975
977
  }
976
978
  },
977
979
 
978
980
  _onKey: function(e){
979
981
  var t = this,
980
982
  g = t.grid,
983
+ ctrlKey = g._isCtrlKey(e),
981
984
  col = g._columnsById[e.columnId];
982
985
  if(col.editable){
983
986
  var editing = t.isEditing(e.rowId, e.columnId);
@@ -1000,24 +1003,24 @@ define([
1000
1003
  t.cancel(e.rowId, e.columnId).then(lang.hitch(t, t._blur)).then(function(){
1001
1004
  g.focus.focusArea('body');
1002
1005
  });
1003
- }else if(e.keyCode == 'Z'.charCodeAt(0) && e.ctrlKey){
1006
+ }else if(e.keyCode == 'Z'.charCodeAt(0) && ctrlKey){
1004
1007
  if(t.arg('lazySave')){
1005
1008
  t.model.undo();
1006
1009
  }
1007
- }else if(e.keyCode == 'Y'.charCodeAt(0) && e.ctrlKey){
1010
+ }else if(e.keyCode == 'Y'.charCodeAt(0) && ctrlKey){
1008
1011
  if(t.arg('lazySave')){
1009
1012
  t.model.redo();
1010
1013
  }
1011
- }else if(e.keyCode == 'S'.charCodeAt(0) && e.ctrlKey){
1014
+ }else if(e.keyCode == 'S'.charCodeAt(0) && ctrlKey){
1012
1015
  if(t.arg('lazySave')){
1013
1016
  t.model.save();
1014
1017
  e.preventDefault();
1015
1018
  }
1016
1019
  }
1017
1020
  }
1018
- if(t._editing && e.keyCode !== keys.TAB){
1019
- e.stopPropagation();
1020
- }
1021
+ // if(t._editing && e.keyCode !== keys.TAB){
1022
+ // e.stopPropagation();
1023
+ // }
1021
1024
  }
1022
1025
 
1023
1026
  });