[CLOSED] In your example online, can I ONLY the child selectable in the 'Multi Node TreePanel' ??

  1. #1

    [CLOSED] In your example online, can I ONLY the child selectable in the 'Multi Node TreePanel' ??

    Example located here:
    https://examples2.ext.net/#/TreePane...in_CodeBehind/

    Can I ONLY make the most inner child selectable ?

    How can I determine if the MOST inner child was selected on the client side ??
    Last edited by Daniil; Jul 24, 2012 at 8:54 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Returning false from a BeforeSelect listener prevents selecting.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.selection.RowModel-event-beforeselect

    To determine a "most inner node" please use the isLeaf method.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.NodeInterface-method-isLeaf
  3. #3
    What would be the proper syntax for that?

    I have
           tree.Listeners.BeforeSelect.Handler = "if(#{TreePanel1}.isLeaf()) return true; else return false;";
    Quote Originally Posted by Daniil View Post
    Hi,

    Returning false from a BeforeSelect listener prevents selecting.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.selection.RowModel-event-beforeselect

    To determine a "most inner node" please use the isLeaf method.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.NodeInterface-method-isLeaf
  4. #4
    Almost. The isLeaf method belongs to a concrete node/record, not TreePanel.
    tree.Listeners.BeforeSelect.Handler = "return record.isLeaf();";
  5. #5
    I see, thanks that works...

    Before you close this thread, how to clear the selection in the TreePanel on the client side ??

    I can't seem to find the right Property !!

    Quote Originally Posted by Daniil View Post
    Almost. The isLeaf method belongs to a concrete node/record, not TreePanel.
    tree.Listeners.BeforeSelect.Handler = "return record.isLeaf();";
  6. #6
    Here it is.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.selection.Model-method-deselectAll

    Example
    tree.getSelectionModel().deselectAll();

Similar Threads

  1. Replies: 5
    Last Post: Dec 27, 2012, 10:29 AM
  2. Replies: 0
    Last Post: Aug 09, 2012, 8:30 AM
  3. [CLOSED] TreePanel node not selectable
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Jun 30, 2011, 8:33 PM
  4. How to expand all child nodes for current node?
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: May 26, 2009, 2:53 PM
  5. TreePanel:Copying from one node to another node using drag and drop
    By eighty20 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 25, 2009, 7:48 AM

Tags for this Thread

Posting Permissions