-/*!
- * Ext JS Library 3.0.0
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-Ext.onReady(function(){\r
- Ext.Direct.addProvider(Ext.app.REMOTING_API);\r
-\r
- var tree = new Ext.tree.TreePanel({\r
- width: 400,\r
- height: 400,\r
- autoScroll: true,\r
- renderTo: document.body,\r
- root: {\r
- id: 'root',\r
- text: 'Root'\r
- },\r
- loader: new Ext.tree.TreeLoader({\r
- directFn: TestAction.getTree\r
- }),\r
- fbar: [{\r
- text: 'Reload root',\r
- handler: function(){\r
- tree.getRootNode().reload();\r
- }\r
- }]\r
- });\r
-});\r
+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()
+ });
+});