Commit 6ec4203b0b4fb29da516930ad69f59112019c40e

Authored by Elena.Budnik
1 parent f56a0e79

double-click for CellEdit - more stable

Showing 1 changed file with 35 additions and 35 deletions   Show diff stats
js/app/views/FiltersUI.js
... ... @@ -37,7 +37,7 @@ Ext.define('amdaUI.FilterGridPanel', {
37 37  
38 38 constructor: function(config)
39 39 {
40   - this.init(config);
  40 + this.init(config);
41 41 this.callParent(arguments);
42 42 },
43 43  
... ... @@ -71,45 +71,45 @@ Ext.define('amdaUI.FilterGridPanel', {
71 71 this.condStore.removeAll();
72 72  
73 73 this.filtersInfoStore.getById(condType).conditions().data.each(function(cond)
74   - {
75   - this.condStore.add(cond);
76   - },
77   - this
  74 + {
  75 + this.condStore.add(cond);
  76 + },
  77 + this
78 78 );
79 79  
80 80 //update current operators store
81 81 this.opStore.removeAll();
82 82  
83 83 condInfo.ops().data.each(function(op)
84   - {
85   - this.opStore.add({id : op.get('id'), name : op.get('name')});
86   - },
87   - this
  84 + {
  85 + this.opStore.add({id : op.get('id'), name : op.get('name')});
  86 + },
  87 + this
88 88 );
89 89  
90 90 //update current value field
91 91 var valueField = this.getValueField(condInfo);
92   - this.editingPlugin.completeEdit();
  92 + this.editingPlugin.completeEdit();
93 93 this.editingPlugin.setColumnField(this.columns[3],valueField);
94 94  
95 95 //get current cell
96 96 var crtCell;
97   - if (this.getSelectionModel().hasSelection())
98   - crtCell = this.getSelectionModel().getSelection()[0];
  97 + if (this.getSelectionModel().hasSelection()) {
  98 + crtCell = this.getSelectionModel().getSelection()[0];
  99 + }
99 100 else
100   - return;
101   -
  101 + return;
102 102 crtCell.set('condId',condInfo.get('id'));
103   -
  103 +
104 104 if (reset)
105   - {
  105 + {
106 106 //set first operator
107 107 crtCell.set('opId',this.opStore.getAt(0).get('id'));
108 108  
109 109 //reset value field
110 110 switch (valueField.xtype)
111 111 {
112   - case 'combobox' :
  112 + case 'combobox' :
113 113 crtCell.set('value',valueField.store.getAt(0).get('name'));
114 114 break;
115 115 case 'datefield' :
... ... @@ -249,20 +249,20 @@ Ext.define('amdaUI.FilterGridPanel', {
249 249  
250 250 onClearAllConditions : function(t)
251 251 {
252   - var recs = this.store.getGroups();
253   - if (!recs)
254   - return;
255   - Ext.each(recs, function (group)
256   - {
257   - Ext.each(group.children, function (rec)
258   - {
259   - if (rec.get('index') == -1)
260   - return;
261   - this.store.remove(rec);
262   - },this);
263   - },
264   - this);
265   - this.store.group('type');
  252 + var recs = this.store.getGroups();
  253 + if (!recs)
  254 + return;
  255 + Ext.each(recs, function (group)
  256 + {
  257 + Ext.each(group.children, function (rec)
  258 + {
  259 + if (rec.get('index') == -1)
  260 + return;
  261 + this.store.remove(rec);
  262 + },this);
  263 + },
  264 + this);
  265 + this.store.group('type');
266 266 },
267 267  
268 268 onSelectConditionType : function(combo,records,eOpts)
... ... @@ -275,14 +275,14 @@ Ext.define('amdaUI.FilterGridPanel', {
275 275 createCellEditingPlugin : function()
276 276 {
277 277 var cellPlug = Ext.create('Ext.grid.plugin.CellEditing', {
278   - clicksToEdit: 1,
  278 + clicksToEdit: 2,
279 279 listeners: {
280   - beforeedit: function(o, el, opt) {
  280 + beforeedit: function(o, el, opt) {
281 281 if ((el.field == 'logical') && (el.record.get('index') <= 0))
282   - return false;
  282 + return false;
283 283 return true;
284 284 }
285   - }
  285 + }
286 286 });
287 287  
288 288 return cellPlug;
... ...