Do not show PlantID in myplants
[L-seed.git] / web / php / page / myplants.pg
index f74743b..77d6f6c 100644 (file)
@@ -6,13 +6,9 @@
        ,layout: 'fit'
        ,items: [{
                id: "plantlistgrid"
-               ,title: "Mein Pflanzen"
+               ,title: "Saisons"
                ,xtype: 'grid'
                ,autoExpandColumn: 'Code'
-               ,plugins: [new Ext.ux.RowEditor({
-                       id: 'plantlistgridEditor'
-                       ,saveText: 'Update'
-               })]
                ,view: new Ext.grid.GroupingView({
                        markDirty: false  
                })
                        ,cls: 'x-btn-text-icon'
                        ,disabled: true
                        ,handler: function(){
-                               Ext.getCmp("plantlistgridEditor").stopEditing();
                                var grid = Ext.getCmp("plantlistgrid");
                                var s = grid.getSelectionModel().getSelections();
                                for(var i = 0, r; r = s[i]; i++) {
                                    grid.getStore().remove(r);
                                }
                        }
-               },{
-                       id: 'plantlistCheckPlantSyntax'
-                       ,text: 'Check Syntax'
-                       ,icon: 'img/icons/accept.png'
-                       ,cls: 'x-btn-text-icon'
-                       ,disabled: true
-                       ,handler: editor.CheckSyntax.createDelegate(editor, ['plantlistgrid'], true)
                },{
                        id: 'plantlistActivatePlant'
                        ,text: 'Activate'
                        ,cls: 'x-btn-text-icon'
                        ,disabled: true
                        ,handler: function(){
-                               Ext.getCmp("plantlistgridEditor").stopEditing();
                                var grid = Ext.getCmp("plantlistgrid");
                                var selected = grid.getSelectionModel().getSelections();
                                if(selected.length > 0) {
                                    editor.Activate(selected[0]);
                                }
                        }
+               },{
+                       id: 'plantlistEditPlant'
+                       ,text: 'Edit'
+                       ,icon: 'img/icons/edit.png'
+                       ,cls: 'x-btn-text-icon'
+                       ,disabled: true
+                       ,handler: function(){
+                               var grid = Ext.getCmp("plantlistgrid");
+                               var selected = grid.getSelectionModel().getSelections();
+                               if(selected.length > 0) {
+                                   editor.Edit(selected[0]);
+                               }
+                       }
                },{
                        id: 'plantlistRefresh'
                        ,text: 'Refresh'
                ,columns: [
                        new Ext.grid.RowNumberer()
                        ,{
-                               id: 'ID'
-                               ,header: 'ID'
-                               ,width: 200
-                               ,sortable: true
-                               ,dataIndex: 'ID'
-                       },{
                                id: 'Name'
                                ,header: 'Name'
                                ,width: 200
                                        xtype: 'textfield'
                                        ,allowBlank: true
                                }
+                       },{
+                               id: 'IsValid'
+                               ,header: 'Valid'
+                               ,width: 50
+                               ,sortable: true
+                               ,dataIndex: 'IsValid'
+                               ,renderer: function (value, metadata, record, rowindex, colindex, store) {
+                                       if (value) {
+                                               return '<img src="img/icons/accept.png"/>';
+                                       } else {
+                                               return '<img src="img/icons/cross.png"/>';
+                                       }
+                               }
                        },{
                                id: 'IsActive'
                                ,header: 'IsActive'
-                               ,width: 200
+                               ,width: 50
                                ,sortable: true
                                ,dataIndex: 'IsActive'
+                               ,renderer: function (value, metadata, record, rowindex, colindex, store) {
+                                       if (value) {
+                                               return '<img src="img/icons/award.png"/>';
+                                       } else {
+                                               return '';
+                                       }
+                               }
                        }
                ]
                ,sm: new Ext.grid.RowSelectionModel({
                        ,listeners: {
                                rowselect: function() {
                                        Ext.getCmp("plantlistDeletePlant").enable();
-                                       Ext.getCmp("plantlistCheckPlantSyntax").enable();
                                        Ext.getCmp("plantlistActivatePlant").enable();
+                                       Ext.getCmp("plantlistEditPlant").enable();
                                }
                                ,rowdeselect: function() {
                                        Ext.getCmp("plantlistDeletePlant").disable();
-                                       Ext.getCmp("plantlistCheckPlantSyntax").disable();
-                                       Ext.getCmp("plantlistActivatePlant").disable();
                                        Ext.getCmp("plantlistActivatePlant").disable();
+                                       Ext.getCmp("plantlistEditPlant").disable();
                                }
                        }
                })