1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    19
    Vote Rating
    0
    kencl is on a distinguished road

      0  

    Default Unanswered: How do I display a value that's in a store?

    Unanswered: How do I display a value that's in a store?


    I have a store with only 1 field in it, vehicleMake. I have a second store, searchResults, which has a number of fields, one of which is "make_index". This make_index is the array index value for the vehicleMake store, so what I want to do is use the index from one store to lookup the value in the second store.

    In a template, {make_index} displays the number. I want to do something like vehicleStore[{make_index}] to display the name of the make (which is the value stored in the vehicleMake store).

    I just don't know the syntax for the store lookup. Thanks.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,824
    Answers
    3470
    Vote Rating
    836
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should use a template method in your XTemplate. The template method would then return whatever value you need to display.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1