Typos
[L-seed.git] / web / php / page / myplants.pg
1 {
2         id: 'ContentPanel_myplants'
3         ,closable: true
4         ,style: 'padding: 5px;'
5         ,title: 'Meine Pflanzen'
6         ,layout: 'fit'
7         ,items: [{
8                 id: "plantlistgrid"
9                 ,title: "Saisons"
10                 ,xtype: 'grid'
11                 ,autoExpandColumn: 'Code'
12                 ,plugins: [new Ext.ux.RowEditor({
13                         id: 'plantlistgridEditor'
14                         ,saveText: 'Update'
15                 })]
16                 ,view: new Ext.grid.GroupingView({
17                         markDirty: false  
18                 })
19                 ,tbar: [{
20                         id: 'plantlistDeletePlant'
21                         ,text: 'Delete'
22                         ,icon: 'img/icons/cross.png'
23                         ,cls: 'x-btn-text-icon'
24                         ,disabled: true
25                         ,handler: function(){
26                                 Ext.getCmp("plantlistgridEditor").stopEditing();
27                                 var grid = Ext.getCmp("plantlistgrid");
28                                 var s = grid.getSelectionModel().getSelections();
29                                 for(var i = 0, r; r = s[i]; i++) {
30                                     grid.getStore().remove(r);
31                                 }
32                         }
33                 },{
34                         id: 'plantlistCheckPlantSyntax'
35                         ,text: 'Check Syntax'
36                         ,icon: 'img/icons/accept.png'
37                         ,cls: 'x-btn-text-icon'
38                         ,disabled: true
39                         ,handler: editor.CheckSyntax.createDelegate(editor, ['plantlistgrid'], true)
40                 },{
41                         id: 'plantlistActivatePlant'
42                         ,text: 'Activate'
43                         ,icon: 'img/icons/award.png'
44                         ,cls: 'x-btn-text-icon'
45                         ,disabled: true
46                         ,handler: function(){
47                                 Ext.getCmp("plantlistgridEditor").stopEditing();
48                                 var grid = Ext.getCmp("plantlistgrid");
49                                 var selected = grid.getSelectionModel().getSelections();
50                                 if(selected.length > 0) {
51                                     editor.Activate(selected[0]);
52                                 }
53                         }
54                 },{
55                         id: 'plantlistEditPlant'
56                         ,text: 'Edit'
57                         ,icon: 'img/icons/edit.png'
58                         ,cls: 'x-btn-text-icon'
59                         ,disabled: true
60                         ,handler: function(){
61                                 Ext.getCmp("plantlistgridEditor").stopEditing();
62                                 var grid = Ext.getCmp("plantlistgrid");
63                                 var selected = grid.getSelectionModel().getSelections();
64                                 if(selected.length > 0) {
65                                     editor.Edit(selected[0]);
66                                 }
67                         }
68                 },{
69                         id: 'plantlistRefresh'
70                         ,text: 'Refresh'
71                         ,icon: 'img/icons/arrow_refresh.png'
72                         ,cls: 'x-btn-text-icon'
73                         ,handler: communication.GetPlantList.createDelegate(communication)
74                 }]
75                 ,store: new Ext.data.GroupingStore({
76                         reader: new Ext.data.JsonReader({fields: Lseed.Plant})
77                         ,sortInfo: {field: 'Name', direction: 'ASC'}
78                         ,data: []
79                         ,listeners: {
80                                 add: function(sender, records, index) {
81                                 },
82                                 remove: function(sender, record, index) {
83                                         editor.Delete(record);
84                                 },
85                                 update: function(sender, record, operation) {
86                                         if (operation == Ext.data.Record.EDIT) {
87                                         } else if (Ext.data.Record.REJECT) {
88                                         } else if (Ext.data.Record.COMMIT) {
89                                         }
90                                 }
91                         }
92                 })
93                 ,columns: [
94                         new Ext.grid.RowNumberer()
95                         ,{
96                                 id: 'ID'
97                                 ,header: 'ID'
98                                 ,width: 200
99                                 ,sortable: true
100                                 ,dataIndex: 'ID'
101                         },{
102                                 id: 'Name'
103                                 ,header: 'Name'
104                                 ,width: 200
105                                 ,sortable: true
106                                 ,dataIndex: 'Name'
107                         },{
108                                 id: 'Code'
109                                 ,header: 'Code'
110                                 ,width: 200
111                                 ,sortable: true
112                                 ,dataIndex: 'Code'
113                                 ,editor: {
114                                         xtype: 'textfield'
115                                         ,allowBlank: true
116                                 }
117                         },{
118                                 id: 'IsActive'
119                                 ,header: 'IsActive'
120                                 ,width: 200
121                                 ,sortable: true
122                                 ,dataIndex: 'IsActive'
123                         }
124                 ]
125                 ,sm: new Ext.grid.RowSelectionModel({
126                         singleSelect:true
127                         ,listeners: {
128                                 rowselect: function() {
129                                         Ext.getCmp("plantlistDeletePlant").enable();
130                                         Ext.getCmp("plantlistCheckPlantSyntax").enable();
131                                         Ext.getCmp("plantlistActivatePlant").enable();
132                                         Ext.getCmp("plantlistEditPlant").enable();
133                                 }
134                                 ,rowdeselect: function() {
135                                         Ext.getCmp("plantlistDeletePlant").disable();
136                                         Ext.getCmp("plantlistCheckPlantSyntax").disable();
137                                         Ext.getCmp("plantlistActivatePlant").disable();
138                                         Ext.getCmp("plantlistEditPlant").disable();
139                                 }
140                         }
141                 })
142         }]
143         ,listeners: {
144                 show: communication.GetPlantList.createDelegate(communication)
145         }
146 }