Skip to content

Commit

Permalink
Couple of suggested style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
edspencer committed Aug 4, 2011
1 parent 953148e commit 1f78d07
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions ObjectBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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) {
Expand Down

0 comments on commit 1f78d07

Please sign in to comment.