X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..6746dc89c47ed01b165cc1152533605f97eb8e8d:/examples/forum/classes/TopicGrid.js diff --git a/examples/forum/classes/TopicGrid.js b/examples/forum/classes/TopicGrid.js deleted file mode 100644 index d8e3757d..00000000 --- a/examples/forum/classes/TopicGrid.js +++ /dev/null @@ -1,125 +0,0 @@ -Ext.define('ForumBrowser.TopicGrid', { - - extend: 'Ext.grid.Panel', - - alias: 'widget.topicgrid', - - initComponent: function(){ - var store = Ext.create('Ext.data.Store', { - model: 'ForumBrowser.Topic', - remoteSort: true, - sorters: [{ - property: 'lastpost', - direction: 'DESC' - }], - proxy: { - simpleSortMode: true, - type: 'jsonp', - url: 'http://sencha.com/forum/topics-browse-remote.php', - reader: { - type: 'json', - root: 'topics', - totalProperty: 'totalCount' - } - } - }); - - Ext.apply(this, { - store: store, - viewConfig: { - plugins: [{ - pluginId: 'preview', - ptype: 'preview', - bodyField: 'excerpt', - expanded: true - }] - }, - selModel: Ext.create('Ext.selection.RowModel', { - mode: 'SINGLE', - listeners: { - scope: this, - select: this.onSelect - } - }), - columns: [ - { - header: 'Topic', - dataIndex: 'title', - flex: 1, - renderer: function(value, o, record) { - return Ext.String.format('
{0}{1}
', - value, record.get('author')); - } - }, { - header: 'Author', - dataIndex: 'author', - width: 100 - //hidden: true - }, { - header: 'Replies', - dataIndex: 'replycount', - width: 70, - align: 'right' - }, { - header: 'Last Post', - dataIndex: 'lastpost', - width: 150, - renderer: function(value, o, rec){ - return Ext.String.format('{0}
by {1}', Ext.Date.format(value, 'M j, Y, g:i a'), rec.get('lastposter')); - } - } - ], - dockedItems: [{ - xtype: 'toolbar', - cls: 'x-docked-noborder-top', - items: [{ - text: 'New Topic', - iconCls: 'icon-new-topic', - handler: function(){ - alert('Not implemented'); - } - }, '-', { - text: 'Preview Pane', - iconCls: 'icon-preview', - enableToggle: true, - pressed: true, - scope: this, - toggleHandler: this.onPreviewChange - }, { - text: 'Summary', - iconCls: 'icon-summary', - enableToggle: true, - pressed: true, - scope: this, - toggleHandler: this.onSummaryChange - }] - }, { - dock: 'bottom', - xtype: 'pagingtoolbar', - store: store, - displayInfo: true, - displayMsg: 'Displaying topics {0} - {1} of {2}', - emptyMsg: 'No topics to display' - }] - }); - this.callParent(); - }, - - onSelect: function(selModel, rec){ - this.ownerCt.onSelect(rec); - }, - - loadForum: function(id){ - var store = this.store; - store.getProxy().extraParams.forumId = id; - store.loadPage(1); - }, - - onPreviewChange: function(btn, pressed){ - this.ownerCt.togglePreview(pressed); - }, - - onSummaryChange: function(btn, pressed){ - this.getView().getPlugin('preview').toggleExpanded(pressed); - } -});