Results 1 to 2 of 2

Thread: How to change clicked node of Ext TreePanel inside of an Ext Panel

  1. #1
    Ext User
    Join Date
    Sep 2010
    Vote Rating

    Default How to change clicked node of Ext TreePanel inside of an Ext Panel

    I am trying to change either the CSS or the text property of a clicked node inside my treepanel which is added to a regular ext panel. In my below code I define a treenode as the root node and append several child nodes to it. I then take all the treenodes and add them to a TreePanel which is added to my extjs panel containing all the treenodes. Is there anyway to change the css or text property of each item in the ext Panel so that when I click on one item it has say red text instead of the black text except all other items go back to black text. Not sure if this is the best way to do this either as I just have a large menu of "themes" but each one has its own items under it so this is why I have done it this way. Appreciate any assistance.

    //Base Map Root Node
    var layer_Base_Root = new Ext.tree.TreeNode({
    cls: 'rootnode',
    text: "Base Maps",
    singleClickExpand: true,
    expanded: true
    //Base Map Child 
    var layer_BaseMap_Child = new Ext.tree.TreeNode({
    text: "Base Map",
    cls: 'childnode',
    listeners: {
    click: function (node, event) {
    changeTheme(node.text, map, mapPanel, false);
    //Base Map Tree Panel
    var layerTree_Base = new Ext.tree.TreePanel({
    root: layer_Base_Root,
    rootVisible: true,
    preloadChildren: true
    panel_Themes = new Ext.Panel({
    collapsed: false,
    height: 360,
    applyTo: 'themes',
    autoScroll: true,
    items: [layerTree_Base, other layer items after this]

  2. #2
    Sencha User's Avatar
    Join Date
    Mar 2007
    DC Area =)
    Vote Rating


    once you have the reference to the tree node, why not just call node.setText() ?

Similar Threads

  1. [OPEN-1103] IE8 TreePanel flashes when node clicked
    By aj3423 in forum Ext 3.x: Bugs
    Replies: 3
    Last Post: 18 Nov 2012, 11:08 PM
  2. How do I display the path to a clicked node in my TreePanel ?
    By kliphuis in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 12 Nov 2010, 2:44 PM
  3. Ext.TreePanel get a to an other panel
    By Loader in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 9 Mar 2010, 2:05 PM
  4. Collaspe all node except one which is clicked ext js tree
    By combay in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 29 Apr 2009, 10:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts