Remove CheckSyntax button from plant list
[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                 ,view: new Ext.grid.GroupingView({
13                         markDirty: false  
14                 })
15                 ,tbar: [{
16                         id: 'plantlistDeletePlant'
17                         ,text: 'Delete'
18                         ,icon: 'img/icons/cross.png'
19                         ,cls: 'x-btn-text-icon'
20                         ,disabled: true
21                         ,handler: function(){
22                                 var grid = Ext.getCmp("plantlistgrid");
23                                 var s = grid.getSelectionModel().getSelections();
24                                 for(var i = 0, r; r = s[i]; i++) {
25                                     grid.getStore().remove(r);
26                                 }
27                         }
28                 },{
29                         id: 'plantlistActivatePlant'
30                         ,text: 'Activate'
31                         ,icon: 'img/icons/award.png'
32                         ,cls: 'x-btn-text-icon'
33                         ,disabled: true
34                         ,handler: function(){
35                                 var grid = Ext.getCmp("plantlistgrid");
36                                 var selected = grid.getSelectionModel().getSelections();
37                                 if(selected.length > 0) {
38                                     editor.Activate(selected[0]);
39                                 }
40                         }
41                 },{
42                         id: 'plantlistEditPlant'
43                         ,text: 'Edit'
44                         ,icon: 'img/icons/edit.png'
45                         ,cls: 'x-btn-text-icon'
46                         ,disabled: true
47                         ,handler: function(){
48                                 var grid = Ext.getCmp("plantlistgrid");
49                                 var selected = grid.getSelectionModel().getSelections();
50                                 if(selected.length > 0) {
51                                     editor.Edit(selected[0]);
52                                 }
53                         }
54                 },{
55                         id: 'plantlistRefresh'
56                         ,text: 'Refresh'
57                         ,icon: 'img/icons/arrow_refresh.png'
58                         ,cls: 'x-btn-text-icon'
59                         ,handler: communication.GetPlantList.createDelegate(communication)
60                 }]
61                 ,store: new Ext.data.GroupingStore({
62                         reader: new Ext.data.JsonReader({fields: Lseed.Plant})
63                         ,sortInfo: {field: 'Name', direction: 'ASC'}
64                         ,data: []
65                         ,listeners: {
66                                 add: function(sender, records, index) {
67                                 },
68                                 remove: function(sender, record, index) {
69                                         editor.Delete(record);
70                                 },
71                                 update: function(sender, record, operation) {
72                                         if (operation == Ext.data.Record.EDIT) {
73                                         } else if (Ext.data.Record.REJECT) {
74                                         } else if (Ext.data.Record.COMMIT) {
75                                         }
76                                 }
77                         }
78                 })
79                 ,columns: [
80                         new Ext.grid.RowNumberer()
81                         ,{
82                                 id: 'ID'
83                                 ,header: 'ID'
84                                 ,width: 200
85                                 ,sortable: true
86                                 ,dataIndex: 'ID'
87                         },{
88                                 id: 'Name'
89                                 ,header: 'Name'
90                                 ,width: 200
91                                 ,sortable: true
92                                 ,dataIndex: 'Name'
93                         },{
94                                 id: 'Code'
95                                 ,header: 'Code'
96                                 ,width: 200
97                                 ,sortable: true
98                                 ,dataIndex: 'Code'
99                                 ,editor: {
100                                         xtype: 'textfield'
101                                         ,allowBlank: true
102                                 }
103                         },{
104                                 id: 'IsActive'
105                                 ,header: 'IsActive'
106                                 ,width: 200
107                                 ,sortable: true
108                                 ,dataIndex: 'IsActive'
109                         }
110                 ]
111                 ,sm: new Ext.grid.RowSelectionModel({
112                         singleSelect:true
113                         ,listeners: {
114                                 rowselect: function() {
115                                         Ext.getCmp("plantlistDeletePlant").enable();
116                                         Ext.getCmp("plantlistActivatePlant").enable();
117                                         Ext.getCmp("plantlistEditPlant").enable();
118                                 }
119                                 ,rowdeselect: function() {
120                                         Ext.getCmp("plantlistDeletePlant").disable();
121                                         Ext.getCmp("plantlistActivatePlant").disable();
122                                         Ext.getCmp("plantlistEditPlant").disable();
123                                 }
124                         }
125                 })
126         }]
127         ,listeners: {
128                 show: communication.GetPlantList.createDelegate(communication)
129         }
130 }