Results 1 to 9 of 9

Thread: this.getSelectedNodes not working as expected

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    88

    Default this.getSelectedNodes not working as expected

    Hi ,

    I created my own treepanel class extending from Ext.tree.TreePanel .
    This class gets instantiated multiple times in different tabs,so there r different tree in different tabs coming from the same class.
    My tree has MultiSelectionModel which allows me to press 'ctrl' key and select more than one nodes across not just one tree but also from all the other tree instances in other tabs.so far good.
    The issue comes when i do a
    this.getSelectionModel().getSelectedNodes();

    I am expecting the above call to return me all the selected nodes from the current tree ('this' object) ,but somehow I am getting all the selected nodes across all the instances of the tree from all the different tabs.Is this behavior right ?
    The problem is if some nodes are selected in one tab(one instance of the tree) and I do any operation on another instance of the tree in next tab then that operation affects the selected nodes from the earlier tree too which is not what i am expecting.
    I want to know if this is a Ext bug or some wrong implemenation on my side.
    I can provide my tree code or more info if needed ,since its a pretty large file.

    Thanks.any inputs are appreciated.

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    88

    Default

    I am using Ext 2.2.1 , FYI

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Post in the 2.0 help folder then.

    I suspect it's an extend to configure problem.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Show your code!

    Extending to configure is generally bad.

    It has caught on in a horrible way though.

  5. #5
    Sencha User
    Join Date
    Jul 2009
    Posts
    88

    Default

    Hi ,
    I can attach my code,but its a 1000 lines of code and i dont know what part of code could be faulty ,if u could help me understand whats a extend to configure problem ,I can look myself into the code and point out the wrong configurations.
    Please tell me what exactly should I look for or if you want to see my code then what part should i send from the 1000 lines so that its easier for you to go thru ?

    Thanks ,appreciate your help

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Show your tree subclass

  7. #7
    Sencha User
    Join Date
    Jul 2009
    Posts
    88

    Default

    Hi Animal,

    I have attached my Tree subclass.
    Attached Files Attached Files

  8. #8
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Anything you put into the prototype of a class is shared among all instances of that class.

  9. #9
    Sencha User
    Join Date
    Jul 2009
    Posts
    88

    Default

    Thanks a lot ,that cleared the concept and also explained the unusual behavior.

Posting Permissions

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