X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6..HEAD:/examples/tree/reorder.js diff --git a/examples/tree/reorder.js b/examples/tree/reorder.js index c8a48871..88665747 100644 --- a/examples/tree/reorder.js +++ b/examples/tree/reorder.js @@ -1,32 +1,69 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.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', +/* + +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: { - nodeType: 'async', text: 'Ext JS', - draggable: false, - id: 'src' - } + 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(); + } + }] + }] }); +}); - // render the tree - tree.render('tree-div'); - tree.getRootNode().expand(); -}); \ No newline at end of file