Commit 7fc31ac3863243430b49f1cea3b6794c149f0d61
1 parent
1d2290f6
Exists in
master
and in
33 other branches
For now, will come back later
Showing
1 changed file
with
98 additions
and
47 deletions
Show diff stats
js/app/views/CatalogUI.js
... | ... | @@ -20,7 +20,8 @@ Ext.define('amdaUI.CatalogUI', { |
20 | 20 | 'amdaUI.OperationsTT', |
21 | 21 | 'Ext.grid.plugin.BufferedRenderer', |
22 | 22 | 'amdaUI.StatisticalPlug', |
23 | - 'amdaDesktop.AmdaStateProvider' | |
23 | + 'amdaDesktop.AmdaStateProvider', | |
24 | + 'Ext.grid.plugin.CellEditing' | |
24 | 25 | ], |
25 | 26 | |
26 | 27 | isCatalog: true, |
... | ... | @@ -862,10 +863,28 @@ Ext.define('amdaUI.CatalogUI', { |
862 | 863 | ] |
863 | 864 | }); |
864 | 865 | |
866 | + Ext.create('Ext.data.Store', { | |
867 | + storeId:'simpsonsStore', | |
868 | + fields:['name', 'email', 'phone'], | |
869 | + data:{'items':[ | |
870 | + { 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" }, | |
871 | + { 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" }, | |
872 | + { 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" }, | |
873 | + { 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" } | |
874 | + ]}, | |
875 | + proxy: { | |
876 | + type: 'memory', | |
877 | + reader: { | |
878 | + type: 'json', | |
879 | + root: 'items' | |
880 | + } | |
881 | + } | |
882 | + }); | |
883 | + | |
865 | 884 | // Window for the creation of the new Column |
866 | 885 | var window = Ext.create('Ext.window.Window', { |
867 | 886 | title: (isNew) ? 'New Column' : 'Edit Column', |
868 | - width: 275, | |
887 | + width: 575, | |
869 | 888 | height: 210, |
870 | 889 | closable:false, |
871 | 890 | modal:true, |
... | ... | @@ -873,57 +892,89 @@ Ext.define('amdaUI.CatalogUI', { |
873 | 892 | items: [ |
874 | 893 | { |
875 | 894 | xtype: 'form', |
876 | - layout: 'form', | |
895 | + renderTo: Ext.getBody(), | |
896 | + | |
897 | + fieldDefaults: { | |
898 | + labelAlign: 'right', | |
899 | + msgTarget: 'side' | |
900 | + }, | |
901 | + defaults: { | |
902 | + xtype: 'panel', | |
903 | + bodyStyle: {background: '#dfe8f6'}, | |
904 | + flex: 1, | |
905 | + border:false, | |
906 | + layout: 'anchor' | |
907 | + }, | |
908 | + layout:'hbox', | |
877 | 909 | id: 'simpleForm', |
878 | 910 | frame: true, |
879 | 911 | bodyPadding: '5 5 0', |
880 | - fieldDefaults: { | |
881 | - msgTarget: 'side', | |
882 | - labelWidth: 85 | |
883 | - }, | |
884 | 912 | items: [{ |
885 | - // Name | |
886 | - xtype:'textfield', | |
887 | - fieldLabel: 'Column Name', | |
888 | - name: 'nameColumn', | |
889 | - value: (isNew) ? null : columnInfo.name, | |
890 | - allowBlank: false, | |
891 | - tooltip: 'Enter the name of the column you want to create' | |
892 | - },{ | |
893 | - // Type | |
894 | - xtype: 'combobox', | |
895 | - fieldLabel: 'Data Type', | |
896 | - name:'typeColumn', | |
897 | - store:types, | |
898 | - allowBlank: false, | |
899 | - value : (isNew) ? null : columnInfo.type, | |
900 | - queryMode: 'local', | |
901 | - displayField: 'name', | |
902 | - valueField: 'type', | |
903 | - editable: false, | |
904 | - tooltip: 'Enter the type of data you want to put in this column' | |
905 | - }, | |
906 | - { | |
907 | - // Size | |
908 | - xtype:'numberfield', | |
909 | - fieldLabel: 'Size', | |
910 | - name: 'sizeColumn', | |
911 | - value: (isNew) ? 1 : columnInfo.size, | |
912 | - maxValue: 3, | |
913 | - minValue: 1, | |
914 | - allowBlank: false, | |
915 | - tooltip: 'For exemple: 1 for scalar type or 3 for a vector' | |
913 | + items:[{ | |
914 | + // Name | |
915 | + xtype:'textfield', | |
916 | + fieldLabel: 'Column Name', | |
917 | + name: 'nameColumn', | |
918 | + value: (isNew) ? null : columnInfo.name, | |
919 | + allowBlank: false, | |
920 | + tooltip: 'Enter the name of the column you want to create' | |
921 | + },{ | |
922 | + // Type | |
923 | + xtype: 'combobox', | |
924 | + fieldLabel: 'Data Type', | |
925 | + name:'typeColumn', | |
926 | + store:types, | |
927 | + allowBlank: false, | |
928 | + value : (isNew) ? null : columnInfo.type, | |
929 | + queryMode: 'local', | |
930 | + displayField: 'name', | |
931 | + valueField: 'type', | |
932 | + editable: false, | |
933 | + tooltip: 'Enter the type of data you want to put in this column' | |
934 | + }, | |
935 | + { | |
936 | + // Size | |
937 | + xtype:'numberfield', | |
938 | + fieldLabel: 'Size', | |
939 | + name: 'sizeColumn', | |
940 | + value: (isNew) ? 1 : columnInfo.size, | |
941 | + maxValue: 3, | |
942 | + minValue: 1, | |
943 | + allowBlank: false, | |
944 | + tooltip: 'For exemple: 1 for scalar type or 3 for a vector' | |
945 | + }, | |
946 | + { | |
947 | + // Name | |
948 | + xtype:'textarea', | |
949 | + fieldLabel: 'Description', | |
950 | + name: 'descriptionColumn', | |
951 | + height:50, | |
952 | + value: (isNew) ? null : columnInfo.description, | |
953 | + allowBlank: true, | |
954 | + }] | |
916 | 955 | }, |
917 | 956 | { |
918 | - // Name | |
919 | - xtype:'textarea', | |
920 | - fieldLabel: 'Description', | |
921 | - name: 'descriptionColumn', | |
922 | - height:50, | |
923 | - value: (isNew) ? null : columnInfo.description, | |
924 | - allowBlank: true, | |
925 | - } | |
926 | - ], | |
957 | + items:[ | |
958 | + { | |
959 | + xtype:'grid', | |
960 | + title: 'Status Color', | |
961 | + store: Ext.data.StoreManager.lookup('simpsonsStore'), | |
962 | + columns: [ | |
963 | + { text: 'Value', dataIndex: 'name',flex: 1,editor: 'textfield'}, | |
964 | + { text: 'Label', dataIndex: 'email', flex: 1,editor: 'textfield' }, | |
965 | + { text: 'Color', dataIndex: 'phone',flex: 1,editor: 'textfield' } | |
966 | + ], | |
967 | + selType: 'cellmodel', | |
968 | + plugins: [ | |
969 | + Ext.create('Ext.grid.plugin.CellEditing', { | |
970 | + clicksToEdit: 1 | |
971 | + }) | |
972 | + ], | |
973 | + height: 120, | |
974 | + width: 200, | |
975 | + renderTo: Ext.getBody() | |
976 | + }], | |
977 | + }], | |
927 | 978 | |
928 | 979 | buttons: [{ |
929 | 980 | text: 'Save', |
... | ... |