[CLOSED] How do I disable the TreePanel expand on double click

  1. #1

    [CLOSED] How do I disable the TreePanel expand on double click

    I have set the DblClick listener for the TreePanel to perform an action.

    The problem is that each time I double click the node expands or collapses.

    e.preventDefault() and e.stopEvent() don't work as the expand/collapse has already been triggered.

    How do I disable the expand/collapse on double click?
    Last edited by Daniil; Jun 27, 2011 at 12:50 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I can suggest to avoid it overriding the .onDblClick() of TreeNodeUI.

    Example
    <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
    <script type="text/javascript">
        Ext.tree.TreeNodeUI.override({
            // private
            onDblClick : function (e) {
                e.preventDefault();
                if(this.disabled){
                    return;
                }
                if(this.fireEvent("beforedblclick", this.node, e) !== false){
                    if(this.checkbox){
                        this.toggleCheck();
                    }
                    if(!this.animating && this.node.isExpandable()){
                        //this.node.toggle(); commented out
                    }
                    this.fireEvent("dblclick", this.node, e);
                }
            }
        });
    </script>
  3. #3
    Here is a related Ext.NET v2 thread.
    http://forums.ext.net/showthread.php?22633

Similar Threads

  1. Replies: 1
    Last Post: Mar 13, 2012, 8:37 AM
  2. Replies: 2
    Last Post: Aug 04, 2011, 2:14 PM
  3. Fire cell click on row double-click
    By RPIRES in forum 1.x Help
    Replies: 1
    Last Post: Jul 01, 2010, 8:20 PM
  4. [CLOSED] dataview double click
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 02, 2009, 6:05 PM
  5. [CLOSED] Row double click
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 18, 2008, 8:49 AM

Tags for this Thread

Posting Permissions