function Protokoll_Reuse_Links(){
    
    return{
        columnWidth: .6,
        xtype: 'grid',
        stripeRows: true,
        id: 'ProtokollGrid',
        border: false,
        autoHeight: true,
        width: 400,
        cls: 'links',
        title: 'vorhandene Notizen',
        
        autoExpandColumn: 'ProtokollBetreff',
        
        store: new Ext.data.JsonStore({
            xtype: 'jsonstore',
            url: 'frontend/controler/app.php',
            id: 'ProtokollStore',
            baseParams: {
                modul: 'protokoll',
                aktion: 'holen',
                start: 0,
                limit: 10,
                UserId: 0
            },
            root: 'data',
            idProperty: 'id',
            totalProperty: 'anzahl',
            fields: ['id','betreff','zeit','typ']
        }),
    
        sm: new Ext.grid.RowSelectionModel({
		    singleSelect: true
        }),
        
        columns: [{
            "xtype": "gridcolumn",
            "header": "Id",
            "sortable": false,
            "resizable": false,
            "width": 50,
            "dataIndex": "id",
            hidden: true,
            menuDisabled: true
        },{
            "xtype": "gridcolumn",
            "header": "Betreff",
            "sortable": false,
            "resizable": false,
            "width": 150,
            "dataIndex": "betreff",
            id: 'ProtokollBetreff',
            menuDisabled: true
        },{
           "xtype": "gridcolumn",
           "header": "Zeit",
           "sortable": false,
           "resizable": false,
           "width": 150,
           "dataIndex": "zeit",
           menuDisabled: true
        },{
            "xtype": "gridcolumn",
           "header": "Typ",
           "sortable": false,
           "resizable": false,
           "width": 50,
           "dataIndex": "typ",
           menuDisabled: true
        }],
        
        listeners: {
            rowclick: function(grid, number, event){
                
               var select = Ext.getCmp('ProtokollGrid').getSelectionModel();
               var record = select.getSelected();
               var id = record.data.id;

               Ext.getCmp('ProtokollForm').getForm().load({
                  url: 'frontend/controler/app.php',
                  params: {
                      modul: 'protokoll',
                      aktion: 'laden',
                      id: id
                  }
              });
                 
            },
            rowcontextmenu: function(grid, number, event){
                event.stopEvent();
            }
        },
        
        bbar: [{
            xtype: 'paging',
            pageSize: 10,
            store: Ext.StoreMgr.get('ProtokollStore'),
            displayMsg: "Anzeige: {0} - {1} von {2} ",
            displayInfo: true
        }]
        
    }; 

}

function Protokoll_Reuse_Rechts(){
    
    return{
        "xtype": "form",
        "labelWidth": 100,
        "labelAlign": "left",
        title: 'Inhalt der Notiz',
        "layout": "form",
        autoHeight: true,
        id: 'ProtokollForm',
        "width": 300,
        "height": 200,
        "padding": 10,
        "items": [{
            "fieldLabel": "Name",
            xtype: 'displayfield',
            cls: 'viewDisplayfield',
            "name": "name",
            width: 200
        },{
           "fieldLabel": "Vorname",
            xtype: 'displayfield',
            cls: 'viewDisplayfield',
            "name": "vorname",
            width: 200
        },{
           "fieldLabel": "Betreff",
            xtype: 'displayfield',
            cls: 'viewDisplayfield',
            "name": "betreff",
            width: 200
        },{
            xtype: 'textarea',
            "name": "information",
            cls: 'viewDisplayfield',
            width: 200,
            height: 200,
            grow: true,
            preventScrollbars: true
        }],
        columnWidth: .4
    }; 

}
