[CLOSED] [1.0] TreePanel SelectedNode Issue

  1. #1

    [CLOSED] [1.0] TreePanel SelectedNode Issue

    I have a simple question and I can't seem to find the answer I just need a function that will allow me to either reset the selected node a TreePanel (its a TreePanel that's created in markup). When I click on the node it keeps it node selected through the rest of the application and I need it pretty much need it to be shown as unselected.

    Or

    Is there a option I can choose when creating the TreePanel so it will not save the selected node. Meaning when the user clicks it, it runs the code but doesn't show it's the one they choose (not highlighted)

    Thanks
  2. #2
    Hi,

    To get the view of selected node as unselected please use this css rule:

    Example
    <head runat="server">
        <title>Ext.Net Example</title>
    
        <style type="text/css">
            .x-tree-node .x-tree-selected {
                background-color: white;
            }
        </style>
    </head>
    To cancel selecting of node you could use this code:

    Example
    <ext:TreePanel runat="server" ...>
        ....
        <SelectionModel>
            <ext:DefaultSelectionModel runat="server" >
                <Listeners>
                    <BeforeSelect Handler="return false;" />
                </Listeners>
            </ext:DefaultSelectionModel>
        </SelectionModel>
    </ext:TreePanel>
  3. #3
    Generally speaking there is the HighlightColor property for this purpose but seems it doesn't work as expected.

    Here is a test case.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:TreePanel runat="server" Height="100" HighlightColor="white" >
            <Root>
                <ext:TreeNode Text="TestNode" />
            </Root>
        </ext:TreePanel>
        </form>
    </body>
    </html>
  4. #4
    Thanks!! The way of checking via the listener works the way I'm expecting.

    Thanks for your help, you can close this ticket.

Similar Threads

  1. [CLOSED] TreePanel Issue
    By sailendra in forum 2.x Premium Help
    Replies: 1
    Last Post: Aug 03, 2012, 11:58 AM
  2. [CLOSED] Treepanel Level issue
    By Daly_AF in forum 1.x Premium Help
    Replies: 1
    Last Post: Jun 07, 2012, 12:00 PM
  3. Replies: 1
    Last Post: May 09, 2012, 8:31 AM
  4. Replies: 2
    Last Post: Nov 22, 2010, 3:41 AM
  5. Replies: 0
    Last Post: May 20, 2010, 4:00 PM

Posting Permissions