Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    33
    Answers
    1
    Vote Rating
    0
    charles.bourasseau is on a distinguished road

      0  

    Default Answered: extjs 4.1 tree refresh a specific node

    Answered: extjs 4.1 tree refresh a specific node


    I would like to refresh a node of a tree.I try something like that to refresh the root and it worked:
    Code:
    this.getStore('MyTreeStore').load({ params: { id: this.getId().getValue()} });
    But now I would like to refresh only one Node and not the whole tree.

  2. If you want to load a particular node, then pass a node/record object in the store's load() call. This will load the data of that node (similar to an expand request of the node).

    Code:
    this.getStore('MyTreeStore').load({ node: someNode});

  3. #2
    Sencha User
    Join Date
    Jul 2010
    Posts
    33
    Answers
    1
    Vote Rating
    0
    charles.bourasseau is on a distinguished road

      0  

    Default


    Would be nice if someone can help

  4. #3
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    153
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Default


    Why just not:
    PHP Code:
    var rowId 1,
      
    columnDataIndex 1,
      
    node treepanel.getStore().getNodeById(rowId);

    node.set(columnDataIndexvalue); 

  5. #4
    Sencha User
    Join Date
    Jul 2010
    Posts
    33
    Answers
    1
    Vote Rating
    0
    charles.bourasseau is on a distinguished road

      0  

    Default


    but it will make an update request, is it possible without that ? Just make a GET request to the server for a specific node.

  6. #5
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    153
    Answers
    11
    Vote Rating
    6
    Romick is on a distinguished road

      0  

    Default


    I don't understand you. This node is specified by rowId and columnId. It node.set will update only this one node.

  7. #6
    Sencha User
    Join Date
    Jul 2010
    Posts
    33
    Answers
    1
    Vote Rating
    0
    charles.bourasseau is on a distinguished road

      0  

    Default


    Yes but it change the data of my node and I don't want to change the data, I just want to refresh.

    Is there any other way to make a refresh rather than update the node ?

  8. #7
    Sencha User
    Join Date
    Oct 2011
    Location
    India
    Posts
    2
    Answers
    1
    Vote Rating
    0
    Ujjwal Reddy is on a distinguished road

      0  

    Default


    If you want to load a particular node, then pass a node/record object in the store's load() call. This will load the data of that node (similar to an expand request of the node).

    Code:
    this.getStore('MyTreeStore').load({ node: someNode});

  9. #8
    Sencha User
    Join Date
    Jul 2010
    Posts
    33
    Answers
    1
    Vote Rating
    0
    charles.bourasseau is on a distinguished road

      0  

    Default


    Thanks it works. I just have another question.

    When I reload the node and the name changed. The tree node keeps the old name, actually it's the "text" property. Should I put the record property under a specific property or is the response correct ?

    Code:
    {
      text: 'New Name',
      children: [array with child nodes],
      success: true
    }
    Or should I reload the parent to get the new name ?

    I think it's related to the issue: http://www.sencha.com/forum/showthre...server-changes

  10. #9
    Sencha User
    Join Date
    Oct 2011
    Location
    India
    Posts
    2
    Answers
    1
    Vote Rating
    0
    Ujjwal Reddy is on a distinguished road

      0  

    Default


    The load() call works just for loading the child nodes of the tree (similar to expanding the node - it doesn't change the expanded node's properties, but gets the child tree nodes). To get the new name, you might want to consider loading the parent tree node (but this loads all its child nodes and might not be an efficient solution).

    If you know the new name before hand, then you use the following -

    Code:
    node.set('text', 'New Name');
    node.commit();
    This will set the name to the new name and commit the record to the store locally. But if the new name can only be gotten from the server, then consider getting the new name through an AJAX request and then using the above code to display the new name.

  11. #10
    Sencha User
    Join Date
    Jul 2010
    Posts
    33
    Answers
    1
    Vote Rating
    0
    charles.bourasseau is on a distinguished road

      0  

    Default


    Thanks for your answer that's inspired me.

    Code:
      Ext.data.Operation.override({    
       setCompleted: function() {
          this.complete = true;
          this.running  = false;
    
    
          if (this.action === 'read' && this.node && this.response) {
            data = Ext.decode(this.response.responseText);
            if (Ext.isObject(data.node)) {
              for (var key in data.node) {
                this.node.set(key, data.node[key]);
              }
              this.node.commit();
            }
          }
        }
      });
    I make a small workaround, it's a bit quick and dirty but it work as I expect.


    The server just need to send a response like that:
    Code:
    {
      node: {
        text: 'New Name'
      },
      children: [array with child nodes],
      success: true
    }

Thread Participants: 2

Tags for this Thread