Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext GWT Premium Member takayser's Avatar
    Join Date
    Oct 2008
    Location
    Lucerne, Switzerland
    Posts
    188
    Vote Rating
    0
    takayser is an unknown quantity at this point

      0  

    Default [CLOSED] TreePanel Events.BeforeSelect - cancel

    [CLOSED] TreePanel Events.BeforeSelect - cancel


    In TreePanel, if you try to select a row, cancel the BeforeSelect event, then the previous selected is no more selected (visual). See following example:

    Code:
    @Override
       public void onModuleLoad() {
    
          TreeStore store = new TreeStore();
          TreeModel model = new BaseTreeModel();
          model.set("name", "model a");
          store.add(model, false);
          model = new BaseTreeModel();
          model.set("name", "model b");
          store.add(model, false);
    
          TreePanel panel = new TreePanel<ModelData>(store);
          panel.setDisplayProperty("name");
          
          panel.getSelectionModel().select(model, false);
          
          panel.getSelectionModel().addListener(Events.BeforeSelect, new Listener<SelectionEvent<TreeModel>>() {
             @Override
             public void handleEvent(SelectionEvent<TreeModel> be) {
                be.setCancelled(true);
             }
          });
    
          RootPanel.get().add(panel);
       }
    Win7, FF, GXT trunk

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This is not a bug. This is how it works at the moment. selecting an deselecting are two steps. If you dont want to keep selected items, than they are first cleared before selecting new ones. The beforeselect event gets fired for each model you are going to select.

    We cannot change this in any GXT 2.X release as it would be a braking change.


    We could add a BeforeDeselect and Deselect event, but the time left to the 2.2 release is probably too short.

  3. #3
    Ext GWT Premium Member takayser's Avatar
    Join Date
    Oct 2008
    Location
    Lucerne, Switzerland
    Posts
    188
    Vote Rating
    0
    takayser is an unknown quantity at this point

      0  

    Default


    Thanks for reply. Okay, BeforeDeselect and Deselect event would be a suffice anternative. (At least for my usecase.) Would be great if you could extend that to those events.

  4. #4
    Ext GWT Premium Member takayser's Avatar
    Join Date
    Oct 2008
    Location
    Lucerne, Switzerland
    Posts
    188
    Vote Rating
    0
    takayser is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by sven View Post
    We could add a BeforeDeselect and Deselect event, but the time left to the 2.2 release is probably too short.
    do you have this somewhere on a TODO List?

  5. #5
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Yes i have

Similar Threads

  1. Replies: 2
    Last Post: 29 Mar 2010, 7:27 AM
  2. [CLOSED][3.0rc1.1] RowEditor not handling cancel
    By arnaldur in forum Ext 3.x: Bugs
    Replies: 9
    Last Post: 13 Nov 2009, 9:55 PM
  3. [DataListEvent ] Events.BeforeSelect
    By nannous in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 25 Feb 2009, 6:43 AM
  4. [OPEN] Ext.tree.TreePanel: unable to cancel events
    By schmidetzki in forum Ext 1.x: Bugs
    Replies: 5
    Last Post: 26 Jun 2007, 6:18 AM

Thread Participants: 1