Results 1 to 2 of 2

Thread: Custom Tree cell using model properties? How to access model values in setCell render

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2011
    Location
    Arizona
    Posts
    64

    Default Custom Tree cell using model properties? How to access model values in setCell render

    I would like to adjust the look of the Tree leafs. I basically want it to show the name of the leaf and then in bold italic a count.

    The problem I am having is that I am not able to figure out how to access my model properties from the store within the render method.

    Here is what I have tried.
    BaseTreeNode model = store.getChild(context.getIndex());

    However this only gives me back the root folders, not the leafs.. The problem is that the index restarts within each folder...

    So my question is how can I access the model property values for every item in my tree.

    Here is basically what I am trying to make my Tree look like, one of my model properties is "count", which i would like to show in italic bold next to the name of each leaf item.

    ie.

    + Techincal Support
    -- Open (5)
    -- On Hold (2)
    + Billing
    -- Open (10)
    -- On Hold (3)

  2. #2
    Sencha Premium Member
    Join Date
    Jul 2011
    Location
    Arizona
    Posts
    64

    Default

    So i got it working simply by adding the logic/bold and italic html to my ValueProvider name and then using the setCell / render method with sb.appendHtmlConstant(value).

    However this does not seem like the correct way of doing it, it feels like all of this should go into the setCell method... I still do not know how to access my model properties for each item in the tree from the setCell render method... could someone please help.

    Thank you

Posting Permissions

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