Results 1 to 5 of 5

Thread: disable/enable treenode

  1. #1

    Default disable/enable treenode

    Hi,
    I would like to enable or disable treenode on a checkable tree.
    I cans disable check with addBeforeCheckChangeHandler implementation but i should like to change the appearance for the disabled nodes.


    I try this without result :
    XElement theElement = this.getView().getElement(theNode) ;
    // ---
    if( enabled ) {
    theElement.enable() ;
    theElement.removeClassName("disabled");
    }
    else {
    theElement.disable() ;
    theElement.addClassName("disabled");
    }


    and in css file for example :
    .disabled {
    text-decoration: underline ;
    color : red ;
    }

    What's wrong or missing ?
    Thx for your help
    Regards,
    Pascal

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    Hi Pascal,
    welcome to the forum. If you write code here please put it in code tags [ code ] *yourCodeHere* [ /code ] (without spaces). That way it'll be much easier to read.

    To your problem:
    1.) When does your code run, i.e. where did you put it?
    2.) "without result" is not a good error description. I guess you have more info. Tell us.
    3.) What else did you try? Debugging? Searching for "disabled" (bad word for searching) by Firebug?

  3. #3

    Default

    Hi,
    I solve it .... i use getView().getElement(theNode) instead of getView().getElementContainer( theNode)

    Thx
    Best regards
    Pascal

  4. #4
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    Quote Originally Posted by psourisseau2 View Post
    Hi,
    I solve it .... i use getView().getElement(theNode) instead of getView().getElementContainer( theNode)

    Thx
    Best regards
    Pascal
    I am confused. You mentioned getElement not getElementContainer in your first post.
    I assume the code above was already the fixed version?!

  5. #5

    Default

    Quote Originally Posted by Andreas Samjeske View Post
    I am confused. You mentioned getElement not getElementContainer in your first post.
    I assume the code above was already the fixed version?!
    Andreas,
    Excuse me, this piece of code works fine : i use getElementContainer for solving node classname modification
    Code:
    
    
    Code:
    // not work
    // XElement theElement = this.getView().getElement(theNode) ; 
    // work
     XElement theElement = this.getView().getElementContainer(theNode) ; 
    // --- 
    if( enabled ) {
    theElement.enable() ;
    theElement.removeClassName("disabled");
    }
    else {
    theElement.disable() ;
    theElement.addClassName("disabled");
    }


    Best regards
    Pascal


Similar Threads

  1. Replies: 2
    Last Post: 30 Oct 2013, 6:23 AM
  2. How to enable treenode draggable on ipad?
    By leezi in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 2 Dec 2011, 2:54 AM
  3. Enable treeNode drop on leaf = true
    By genTaliaru in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 29 Mar 2009, 8:23 AM

Tags for this Thread

Posting Permissions

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