X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..HEAD:/examples/tree/reorder.js diff --git a/examples/tree/reorder.js b/examples/tree/reorder.js index 31d54a3b..88665747 100644 --- a/examples/tree/reorder.js +++ b/examples/tree/reorder.js @@ -1,32 +1,69 @@ -/*! - * Ext JS Library 3.0.0 - * Copyright(c) 2006-2009 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license - */ -Ext.onReady(function(){ - // shorthand - var Tree = Ext.tree; - - var tree = new Tree.TreePanel({ - useArrows: true, - autoScroll: true, - animate: true, - enableDD: true, - containerScroll: true, - border: false, - // auto create TreeLoader - dataUrl: 'get-nodes.php', - - root: { - nodeType: 'async', - text: 'Ext JS', - draggable: false, - id: 'src' - } - }); - - // render the tree - tree.render('tree-div'); - tree.getRootNode().expand(); -}); \ No newline at end of file +/* + +This file is part of Ext JS 4 + +Copyright (c) 2011 Sencha Inc + +Contact: http://www.sencha.com/contact + +GNU General Public License Usage +This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. + +If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. + +*/ +Ext.require([ + 'Ext.tree.*', + 'Ext.data.*', + 'Ext.tip.*' +]); + +Ext.onReady(function() { + Ext.QuickTips.init(); + + var store = Ext.create('Ext.data.TreeStore', { + proxy: { + type: 'ajax', + url: 'get-nodes.php' + }, + root: { + text: 'Ext JS', + id: 'src', + expanded: true + }, + folderSort: true, + sorters: [{ + property: 'text', + direction: 'ASC' + }] + }); + + var tree = Ext.create('Ext.tree.Panel', { + store: store, + viewConfig: { + plugins: { + ptype: 'treeviewdragdrop' + } + }, + renderTo: 'tree-div', + height: 300, + width: 250, + title: 'Files', + useArrows: true, + dockedItems: [{ + xtype: 'toolbar', + items: [{ + text: 'Expand All', + handler: function(){ + tree.expandAll(); + } + }, { + text: 'Collapse All', + handler: function(){ + tree.collapseAll(); + } + }] + }] + }); +}); +