Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Tree Sort ?

  1. #11
    Ext User
    Join Date
    Apr 2008
    Posts
    11

    Default give code sample ??

    Quote Originally Posted by Footeuz View Post
    I solve my problem !

    The problem was on the TreeSorter definition.
    On the event append or insert it did the function updateSort.


    So I made an extend like that :
    Code:
    	Ext.namespace('Ext.ux');
    
    	// create constructor for new class
    	Ext.ux.TreeSorterSimple = function(el, config){
    	    Ext.ux.TreeSorterSimple.superclass.constructor.call(this, el, config);
    	};
    	 
    	Ext.extend(Ext.ux.TreeSorterSimple, Ext.tree.TreeSorter, {
    	    updateSort : function(tree, node){
    	        // on ne tri plus
    	    }
    	});
    And I use my TreeSorterSimple on my tree.

    can u give full code sample (where u apply TreeSorterSimple ) ....
    i am facing same prob..can't solve..

  2. #12

    Default

    Hi Animal,

    I have used following code to sore tree.

    Code:
    onRender: function(){
    
      var
    
    myTreeSorter = new Ext.tree.TreeSorter(Ext.getCmp('folder-tree), {}); myTreeSorter.doSort(Ext.getCmp('folder-tree).getRootNode()); }


    But I am getting problem when I add new node in tree
    n2.attributes[p] is undefined
    sortFn()()ext-all-debug.js (line 25330)
    sort()(function(), undefined)ext-all-debug.js (line 12515)
    sort()(function(), undefined)ext-all-debug.js (line 24333)
    doSort()([Node 84] loaded=true loading=false childrenRendered=true)ext-all-debug.js (line 25343)
    apply()()

    Thanks in advance.......

  3. #13

    Default

    Sorting is enabled by default?
    So how can you explain behaviour of node order in attachment?

    Actually I'd like to ask how I can sort all nodes of tree and than have auto-sotring when I insert new child node?


    Quote Originally Posted by Animal View Post
    Code:
        var myTreeSorter = new Ext.tree.TreeSorter(myTree, {});
        myTreeSorter.doSort(myTree.getRootNode());
    That will perform a case sensitive sort by the text attribute.
    Attached Images Attached Images

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •