Commit 58780dd251921c0b4ed6975f3e04e4815252dec3
1 parent
5ea836ce
Exists in
master
and in
18 other branches
Fix bug with ColorPicker
Showing
3 changed files
with
9 additions
and
8 deletions
Show diff stats
js/app/views/DefaultTreeGrid.js
... | ... | @@ -6,7 +6,7 @@ Ext.define('amdaUI.DefaultTreeGrid', { |
6 | 6 | 'Ext.grid.*', |
7 | 7 | 'Ext.tree.*', |
8 | 8 | 'amdaModel.DefaultValuesModel', |
9 | - 'amdaUI.ColorPicker', | |
9 | + 'amdaUI.GridColorPicker', | |
10 | 10 | 'amdaUI.ColorMap' |
11 | 11 | ], |
12 | 12 | xtype: 'tree-grid', |
... | ... | @@ -68,7 +68,7 @@ Ext.define('amdaUI.DefaultTreeGrid', { |
68 | 68 | } |
69 | 69 | var value = context.record.get(context.field); |
70 | 70 | if (me.isHexCode(value)) { |
71 | - var colorPicker = Ext.create('amdaUI.ColorPicker', { | |
71 | + var colorPicker = Ext.create('amdaUI.GridColorPicker', { | |
72 | 72 | pickerField: context.field, |
73 | 73 | value: value, |
74 | 74 | listeners: { |
... | ... | @@ -136,6 +136,8 @@ Ext.define('amdaUI.DefaultTreeGrid', { |
136 | 136 | |
137 | 137 | if (option && option.type){ |
138 | 138 | fieldType = option.type; |
139 | + if (fieldType == 'colorpicker') | |
140 | + fieldType = 'gridcolorpicker'; | |
139 | 141 | var myStore = Ext.create('Ext.data.Store', { |
140 | 142 | fields: ['key', 'value'], |
141 | 143 | data: option.store |
... | ... | @@ -145,7 +147,7 @@ Ext.define('amdaUI.DefaultTreeGrid', { |
145 | 147 | } |
146 | 148 | else{ |
147 | 149 | if(me.isHexCode(value)){ |
148 | - fieldType = 'colorpicker' | |
150 | + fieldType = 'gridcolorpicker' | |
149 | 151 | } |
150 | 152 | else if(value === true || value === false){ |
151 | 153 | fieldType = 'combobox' |
... | ... |
js/app/views/ColorPicker.js renamed to js/app/views/GridColorPicker.js
js/app/views/StatusGrid.js
... | ... | @@ -4,11 +4,11 @@ Ext.define('StatusColorEditor', { |
4 | 4 | alias: 'widget.statuscoloreditor', |
5 | 5 | |
6 | 6 | requires: [ |
7 | - 'amdaUI.ColorPicker' | |
7 | + 'amdaUI.GridColorPicker' | |
8 | 8 | ], |
9 | 9 | |
10 | 10 | field: { |
11 | - xtype: 'colorpicker' | |
11 | + xtype: 'gridcolorpicker' | |
12 | 12 | }, |
13 | 13 | }); |
14 | 14 | |
... | ... | @@ -158,7 +158,6 @@ Ext.define('amdaUI.StatusGrid', { |
158 | 158 | return { |
159 | 159 | text: 'Color',dataIndex: 'color', width: 40, menuDisabled: true, |
160 | 160 | renderer: function(value) { |
161 | - console.log(value); | |
162 | 161 | return '<div style="background-color:' + value + '; margin-left: auto; \ |
163 | 162 | margin-right: auto;width:15px;height:15px;"></div>'; |
164 | 163 | }, |
... | ... |