Loading template/app/view/ClassGrid.js 0 → 100644 +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); } }); template/app/view/Viewport.js +14 −3 Original line number Diff line number Diff line Loading @@ -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' ], Loading Loading @@ -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 } ] }, { Loading Loading
template/app/view/ClassGrid.js 0 → 100644 +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); } });
template/app/view/Viewport.js +14 −3 Original line number Diff line number Diff line Loading @@ -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' ], Loading Loading @@ -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 } ] }, { Loading