[CLOSED] Multi-Select Tree and Selection Models

  1. #1

    [CLOSED] Multi-Select Tree and Selection Models

    Hi,

    I'm using the Multi-select tree panel (http://forums.ext.net/showthread.php?10022)

    I'd like to fire some code on the selection change, but I'm not sure how to do this - if I add a SelectionModel to the tree definition then the multi-select stops working. For example, if you change your example in the post above like this, the multi-select stops working (instead, it behaves like a normal single-select tree):

    <cc:MultiSelectTreePanel runat="server" Height="300" EnableDD="true">
            <Root>
                <ext:TreeNode Text="Composers" Expanded="true">
                    <Nodes>
                        <ext:TreeNode Text="Beethoven" Expanded="true">
                            <Nodes>
                                <ext:TreeNode Text="Concertos" Expanded="true">
                                    <Nodes>
                                        <ext:TreeNode Text="Concert 1" />
                                        <ext:TreeNode Text="Concert 2" />
                                    </Nodes>
                                </ext:TreeNode>
                            </Nodes>
                        </ext:TreeNode>
                    </Nodes>
                </ext:TreeNode>
            </Root>
            <SelectionModel>
                  <ext:MultiSelectionModel runat="server">
                  <Listeners>
                    <SelectionChange Fn="Cablesense.handleTreeNodeSelectionChange" />
                  </Listeners>
                  </ext:MultiSelectionModel>
            </SelectionModel>
    
    </cc:MultiSelectTreePanel>
    Is "MultiSelectionModel" the right choice? I see in the javascript for the multi-select that they define a Ext.ux.FixedMultiSelectionModel, do I need to somehow tell it to use that?

    Thanks for the help.
    Last edited by Daniil; Jun 14, 2012 at 8:50 PM. Reason: [CLOSED]
  2. #2
    Hi,

    When you define the SelectionModel for the MultiSelectTreePanel it replace the internal FixedMultiSelectionModel one.

    So, you should not define any SelectionModel.

    Please try to set up:
    <Listeners>
        <Render Handler="this.getSelectionModel().on('selectionchange', function () {
                             alert('selectionchange');
                         });" />
    </Listeners>
    for the MultiSelectTreePanel.

Similar Threads

  1. [CLOSED] dynamic selection models
    By GLD in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 02, 2011, 11:14 AM
  2. Replies: 0
    Last Post: Sep 13, 2011, 6:59 AM
  3. Replies: 2
    Last Post: Aug 09, 2011, 10:38 AM
  4. [CLOSED] Is it possible to Select Items of a multi select during ajax event
    By vedagopal2004 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 29, 2010, 6:28 PM
  5. Multi Select select/deselect
    By Palash in forum 1.x Help
    Replies: 2
    Last Post: Sep 18, 2009, 3:49 AM

Posting Permissions