Commit ecc28a04 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Create ClassGrid component for showing fav/hist.

parent 4e7e4629
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
/**
 * Gridpanel for showing list of classes.
 */
Ext.define('Docs.view.ClassGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.classgrid',
    hideHeaders: true,
    border: false,
    bodyBorder: false,
    
    /**
     * @cfg {Object} icons
     * Mapping of class names to icon class names.
     */
    icons: {},

    initComponent: function() {
        this.columns = [
            {
                width: 18,
                dataIndex: 'cls',
                renderer: function(cls, data) {
                    data.tdCls = this.icons[cls];
                },
                scope: this
            },
            {
                dataIndex: 'cls',
                flex: true
            },
            {
                xtype: 'actioncolumn',
                width: 18,
                icon: 'resources/images/x12.png',
                tooltip: 'Delete'
            }
        ];

        this.callParent(arguments);
    }

});
+14 −3
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ Ext.define('Docs.view.Viewport', {
        'Docs.view.cls.Container',
        'Docs.view.index.Container',
        'Docs.view.tree.Tree',
        'Docs.view.ClassGrid',
        'Docs.History'
    ],

@@ -80,11 +81,21 @@ Ext.define('Docs.view.Viewport', {
                    },
                    {
                        xtype: 'tabpanel',
                        height: 100,
                        height: 150,
                        plain: true,
                        items: [
                            {title: 'Favorites'},
                            {title: 'History'}
                            {
                                xtype: 'classgrid',
                                title: 'Favorites',
                                store: Ext.getStore('Favorites'),
                                icons: Docs.icons
                            },
                            {
                                xtype: 'classgrid',
                                title: 'History',
                                store: Ext.getStore('History'),
                                icons: Docs.icons
                            }
                        ]
                    },
                    {