X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/forum/classes/TopicContainer.js
diff --git a/examples/forum/classes/TopicContainer.js b/examples/forum/classes/TopicContainer.js
new file mode 100644
index 00000000..325a8e4d
--- /dev/null
+++ b/examples/forum/classes/TopicContainer.js
@@ -0,0 +1,57 @@
+Ext.define('ForumBrowser.TopicContainer', {
+
+ extend: 'Ext.container.Container',
+
+ alias: 'widget.topiccontainer',
+
+ title: 'Loading...',
+
+ initComponent: function(){
+ Ext.apply(this, {
+ layout: 'border',
+ items: [{
+ itemId: 'grid',
+ xtype: 'topicgrid',
+ region: 'center'
+ }, {
+ split: true,
+ height: 300,
+ region: 'south',
+ itemId: 'preview',
+ title: 'View Topic',
+ bodyPadding: 10,
+ tpl: '{title}
Post details here.'
+ }]
+ });
+ this.callParent();
+ },
+
+ afterLayout: function() {
+ this.callParent();
+
+ // IE6 likes to make the content disappear, hack around it...
+ if (Ext.isIE6) {
+ this.el.repaint();
+ }
+ },
+
+ loadForum: function(rec) {
+ this.tab.setText(rec.get('text'));
+ this.child('#grid').loadForum(rec.getId());
+ },
+
+ onSelect: function(rec) {
+ this.child('#preview').update({
+ title: rec.get('title')
+ });
+ },
+
+ togglePreview: function(show){
+ var preview = this.child('#preview');
+ if (show) {
+ preview.show();
+ } else {
+ preview.hide();
+ }
+ }
+});
\ No newline at end of file