1. #1
    Ext User
    Join Date
    Apr 2008
    Posts
    3
    Vote Rating
    0
    ofang is on a distinguished road

      0  

    Default Answered: Changing color of nodes text in tree for GXT3

    Answered: Changing color of nodes text in tree for GXT3


    Hello


    I try to change color of tree node text in GXT3, In GXT2 version, I can change color using span tag (<span style='color: red'> " + item +"</span>, but this way can not apply in GXT3
    node.JPG


    is there a way to solve this?


    thanks


    ofang

  2. You need to use SafeHtml and do not escape it. Else it will be shown as in your picture. How does your code look like right now?

  3. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    Answers
    60
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You need to use SafeHtml and do not escape it. Else it will be shown as in your picture. How does your code look like right now?

  4. #3
    Ext User
    Join Date
    Apr 2008
    Posts
    3
    Vote Rating
    0
    ofang is on a distinguished road

      0  

    Default


    Thanks for your reply

    But i can't fix this problem in spite of using safeHtml. here is my code and picture

    node2.JPG

    TreeStore<BaseDto> store = new TreeStore<BaseDto>(new KeyProvider());


    Tree<BaseDto, SafeHtml> tree = new Tree<BaseDto, SafeHtml>(store, new ValueProvider<BaseDto, SafeHtml>() {
    ......

    BaseDto m = createModel(SafeHtmlUtils.fromTrustedString("<span style='color:red'>Fast Tree</span>"));
    store.add(m);
    ....

  5. #4
    Ext User
    Join Date
    Apr 2008
    Posts
    3
    Vote Rating
    0
    ofang is on a distinguished road

      0  

    Default


    thanks


    But i can't fix this problem in spite of using SafeHtml. here my code and picture.


    node2.JPG


    TreeStore<BaseDto> store = new TreeStore<BaseDto>(new KeyProvider());


    final Tree<BaseDto, SafeHtml> tree = new Tree<BaseDto, SafeHtml>(store, new ValueProvider<BaseDto, SafeHtml>() {


    ...............


    BaseDto m = createModel(SafeHtmlUtils.fromTrustedString("<span style='color:red'>Fast Tree</span>"));
    store.add(m);


    .................

Thread Participants: 1

Tags for this Thread