added sourcefiles for web frontend
[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: "Mein Pflanzen"
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: 'plantlistTestPlant'
35                         ,text: 'Test'
36                         ,icon: 'img/icons/magnifier.png'
37                         ,cls: 'x-btn-text-icon'
38                         ,disabled: true
39                         ,handler: editor.Test.createDelegate(editor, ['plantlistgrid'], true)
40                 },{
41                         id: 'plantlistRefresh'
42                         ,text: 'Refresh'
43                         ,icon: 'img/icons/arrow_refresh.png'
44                         ,cls: 'x-btn-text-icon'
45                         ,handler: communication.GetPlantList.createDelegate(communication)
46                 }]
47                 ,store: new Ext.data.GroupingStore({
48                         reader: new Ext.data.JsonReader({fields: Lseed.Plant})
49                         ,sortInfo: {field: 'Name', direction: 'ASC'}
50                         ,data: []
51                         ,listeners: {
52                                 add: function(sender, records, index) {
53                                 },
54                                 remove: function(sender, record, index) {
55                                         editor.Delete(record);
56                                 },
57                                 update: function(sender, record, operation) {
58                                         if (operation == Ext.data.Record.EDIT) {
59                                         } else if (Ext.data.Record.REJECT) {
60                                         } else if (Ext.data.Record.COMMIT) {
61                                         }
62                                 }
63                         }
64                 })
65                 ,columns: [
66                         new Ext.grid.RowNumberer()
67                         ,{
68                                 id: 'ID'
69                                 ,header: 'ID'
70                                 ,width: 200
71                                 ,sortable: true
72                                 ,dataIndex: 'ID'
73                         },{
74                                 id: 'Name'
75                                 ,header: 'Name'
76                                 ,width: 200
77                                 ,sortable: true
78                                 ,dataIndex: 'Name'
79                                 ,editor: {
80                                         xtype: 'textfield'
81                                         ,allowBlank: false
82                                 }
83                         },{
84                                 id: 'Code'
85                                 ,header: 'Code'
86                                 ,width: 200
87                                 ,sortable: true
88                                 ,dataIndex: 'Code'
89                                 ,editor: {
90                                         xtype: 'textfield'
91                                         ,allowBlank: true
92                                 }
93                         },{
94                                 id: 'Active'
95                                 ,header: 'Active'
96                                 ,width: 200
97                                 ,sortable: true
98                                 ,dataIndex: 'Active'
99                                 ,editor: {
100                                         xtype: 'checkbox'
101                                 }
102                         }
103                 ]
104                 ,sm: new Ext.grid.RowSelectionModel({
105                         singleSelect:true
106                         ,listeners: {
107                                 rowselect: function() {
108                                         Ext.getCmp("plantlistDeletePlant").enable();
109                                         Ext.getCmp("plantlistTestPlant").enable();
110                                 }
111                                 ,rowdeselect: function() {
112                                         Ext.getCmp("plantlistDeletePlant").disable();
113                                         Ext.getCmp("plantlistTestPlant").disable();
114                                 }
115                         }
116                 })
117         }]
118         ,listeners: {
119                 show: communication.GetPlantList.createDelegate(communication)
120         }
121 }