1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    8
    Vote Rating
    0
    amritsharma is on a distinguished road

      0  

    Default Answered: n00b question -- But I need help with strings in itemTpl. Thanks!

    Answered: n00b question -- But I need help with strings in itemTpl. Thanks!


    Code:
      itemTpl: '<img src="{photo}" width="55" />
    I have a DataView list that I'm populating with a JSON file. I can't figure out how to pass the {photo} attribute into that "src" parameter in the <img> tag.

    I know the model/store/json file are wired correctly, because this works properly.
    Code:
    <div class="test">{thing}</div>
    Thanks all!

  2. amritsharma, is the photo attribute defined as a field in your model?

  3. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    148
    Answers
    12
    Vote Rating
    10
    pentool will become famous soon enough

      0  

    Default


    It looks correct. Aside from the fact that you forgot to closing ' at the end. You may want to add a height value and making sure the {photo} value contains the correct path.

  4. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Answers
    3467
    Vote Rating
    834
    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


    Inspect the DOM to see what the <img> element looks like.
    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.

  5. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    8
    Vote Rating
    0
    amritsharma is on a distinguished road

      0  

    Default


    This is the resulting HTML code with the img tag I get.
    Code:
    <img src width="55">
    <div class="test">Cheese</div>
    My {photo} attribute in the .json file contains a valid URL of a .jpg file one.
    The "Cheese" text above is a value that's derived from the same .json file with {thing}.

    Is {photo} a reserved keyword in Sencha? Maybe renaming it would help? But, im just speculating.

    Thanks Michael.

    P.S. I've learned so much from your answers on these forums that I recently picked up the MEAP of your upcoming book from Manning.

  6. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    8
    Vote Rating
    0
    amritsharma is on a distinguished road

      0  

    Default


    Sorry, in my actual code the quote is closed. I just copied and pasted a fraction of my code here. I should have made sure it's closed here too.

    But, im still struggling with it.

  7. #6
    Sencha User
    Join Date
    Aug 2012
    Posts
    18
    Answers
    2
    Vote Rating
    2
    gruese is on a distinguished road

      1  

    Default


    amritsharma, is the photo attribute defined as a field in your model?

  8. #7
    Sencha User
    Join Date
    Aug 2012
    Posts
    8
    Vote Rating
    0
    amritsharma is on a distinguished road

      0  

    Default


    Thanks!

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi