Do not show PlantID in myplants
[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: 'Name'
83                                 ,header: 'Name'
84                                 ,width: 200
85                                 ,sortable: true
86                                 ,dataIndex: 'Name'
87                         },{
88                                 id: 'Code'
89                                 ,header: 'Code'
90                                 ,width: 200
91                                 ,sortable: true
92                                 ,dataIndex: 'Code'
93                                 ,editor: {
94                                         xtype: 'textfield'
95                                         ,allowBlank: true
96                                 }
97                         },{
98                                 id: 'IsValid'
99                                 ,header: 'Valid'
100                                 ,width: 50
101                                 ,sortable: true
102                                 ,dataIndex: 'IsValid'
103                                 ,renderer: function (value, metadata, record, rowindex, colindex, store) {
104                                         if (value) {
105                                                 return '<img src="img/icons/accept.png"/>';
106                                         } else {
107                                                 return '<img src="img/icons/cross.png"/>';
108                                         }
109                                 }
110                         },{
111                                 id: 'IsActive'
112                                 ,header: 'IsActive'
113                                 ,width: 50
114                                 ,sortable: true
115                                 ,dataIndex: 'IsActive'
116                                 ,renderer: function (value, metadata, record, rowindex, colindex, store) {
117                                         if (value) {
118                                                 return '<img src="img/icons/award.png"/>';
119                                         } else {
120                                                 return '';
121                                         }
122                                 }
123                         }
124                 ]
125                 ,sm: new Ext.grid.RowSelectionModel({
126                         singleSelect:true
127                         ,listeners: {
128                                 rowselect: function() {
129                                         Ext.getCmp("plantlistDeletePlant").enable();
130                                         Ext.getCmp("plantlistActivatePlant").enable();
131                                         Ext.getCmp("plantlistEditPlant").enable();
132                                 }
133                                 ,rowdeselect: function() {
134                                         Ext.getCmp("plantlistDeletePlant").disable();
135                                         Ext.getCmp("plantlistActivatePlant").disable();
136                                         Ext.getCmp("plantlistEditPlant").disable();
137                                 }
138                         }
139                 })
140         }]
141         ,listeners: {
142                 show: communication.GetPlantList.createDelegate(communication)
143         }
144 }