1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    141
    Vote Rating
    0
    armandoxxx is on a distinguished road

      0  

    Default Add new AsyncTreeNode and show it

    Add new AsyncTreeNode and show it


    Hi

    I'm having a problem with adding AsyncTreeNode into a TreePanel.

    Process goes like this ...
    I have a node in a tree (which is shown like a leaf) and I want to add a subnode to it.
    I do that with Ajax.request and record is inserted. Then I would like to refresh current node to show me sub nodes.
    when I make a call currentNode.reload() I get "currentNode.reload() is not a function"

    I've been surfing these forums and I don't have a single clue of what the hack is wrong ...

    PHP Code:

    tree
    .on('some event ',
        function(
    node,e){
            
    Ext.Ajax.request(
            {
                    
    url            '/add_new_node/'+node.id,
            
    success    : function(response,result){
                           
    this.reload();    
                    },
                    
    failure    : function(response,result){  // failure code 
                    
    },
                    
    scopenode
                    
    }
           );
        }


  2. #2
    Ext JS Premium Member saJoshua's Avatar
    Join Date
    Nov 2007
    Location
    South Africa
    Posts
    521
    Vote Rating
    5
    saJoshua is on a distinguished road

      0  

    Default


    have a look at this post : http://extjs.com/forum/showthread.ph...781#post192781

    does this help?

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Posts
    141
    Vote Rating
    0
    armandoxxx is on a distinguished road

      0  

    Default [FIXED]

    [FIXED]


    this is my new Ajax request and now it's working
    I had to realod parentNode of my current node, so my currentNode is not leaf anymore ..
    then find my node (with ID) in the relaoded nodes tree.findNodeById(nodeID); since references change (if I know anything about what's going on) to get my current node back .. and after that reload my currentNode and it works like a charm ...


    PHP Code:

    Ext
    .Ajax.request(
        {
            
    url    '/admin_extjs/actions/add_new_node/'+node.id,
            
    success    : function(response,result){
                
    this.parentNode.addListener(
                    
    'load'
                    function(
    parentNode) {
                        var 
    tree    parentNode.getOwnerTree();
                        var 
    newNode tree.getNodeById(node.id);
                        
    newNode.reload();
                    }
                );
                
    this.parentNode.reload();
            },
            
    failure    : function(response,result){
                var 
    message        Ext.util.JSON.decode(result.responseText);
                
    Ext.MessageBox.alert('Error'message.data);
            },
            
    scopenode
        
    }
    ); 

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi