Skip to content
Browse files

Couple of suggested style changes

  • Loading branch information...
1 parent 953148e commit 1f78d07b2055671ba44cd611a0434fea8aaf4ca4 @edspencer committed Aug 4, 2011
Showing with 12 additions and 10 deletions.
  1. +12 −10 ObjectBrowser.js
View
22 ObjectBrowser.js
@@ -23,11 +23,14 @@ Ext.define('Components.ObjectBrowser', {
});
this.store = this.createStore(this.data);
- Components.ObjectBrowser.superclass.initComponent.apply(this, arguments);
+
+ return this.callParent(arguments);
},
createStore: function (data) {
- Ext.define(this.id + '-Objects', {
+ var modelName = this.id + '-Objects';
+
+ Ext.define(modelName, {
extend: 'Ext.data.Model',
fields: [{
name: 'key',
@@ -37,19 +40,18 @@ Ext.define('Components.ObjectBrowser', {
type: 'string'
}]
});
-
- var o = { text: 'root' };
- o.children = this.parseObject(data);
- var store = Ext.create('Ext.data.TreeStore', {
- folderSort: true,
- model: this.id + '-Objects',
+ return Ext.create('Ext.data.TreeStore', {
+ folderSort: true,
+ model: modelName,
proxy: {
type: 'memory',
- data: o
+ data: {
+ text: 'root',
+ children: this.parseObject(data)
+ }
}
});
- return store;
},
parseObject: function (o) {

0 comments on commit 1f78d07

Please sign in to comment.
Something went wrong with that request. Please try again.