X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/direct/direct-tree.js diff --git a/examples/direct/direct-tree.js b/examples/direct/direct-tree.js index 0d32000e..0f795fc9 100644 --- a/examples/direct/direct-tree.js +++ b/examples/direct/direct-tree.js @@ -1,29 +1,32 @@ -/*! - * Ext JS Library 3.1.1 - * Copyright(c) 2006-2010 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license - */ -Ext.onReady(function(){ - Ext.Direct.addProvider(Ext.app.REMOTING_API); - - var tree = new Ext.tree.TreePanel({ - width: 400, - height: 400, - autoScroll: true, - renderTo: document.body, - root: { - id: 'root', - text: 'Root' - }, - loader: new Ext.tree.TreeLoader({ - directFn: TestAction.getTree - }), - fbar: [{ - text: 'Reload root', - handler: function(){ - tree.getRootNode().reload(); - } - }] - }); -}); +Ext.require([ + 'Ext.direct.*', + 'Ext.data.*', + 'Ext.tree.*', + 'Ext.grid.Scroller' +]); + +Ext.onReady(function() { + Ext.direct.Manager.addProvider(Ext.app.REMOTING_API); + + var store = Ext.create('Ext.data.TreeStore', { + root: { + expanded: true + }, + proxy: { + type: 'direct', + directFn: TestAction.getTree, + paramOrder: ['node'] + } + }); + + + // create the Tree + var tree = Ext.create('Ext.tree.Panel', { + store: store, + height: 350, + width: 600, + title: 'Tree Sample', + rootVisible: false, + renderTo: Ext.getBody() + }); +});