Results 1 to 2 of 2

Thread: How do you include a sencha touch icon within itemTpl

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    151
    Answers
    19
    Vote Rating
    0
      0  

    Default Answered: How do you include a sencha touch icon within itemTpl

    If I have a list with the following:

    Code:
    itemTpl: '{name} <tpl if="is_locked == 0">LOCKED</tpl>',
    Then how do I correctly replace the word LOCKED with the sencha touch icon "sdk/resources/themes/images/default/pictos/lock_closed.png"

    Best Regards,
    What comes around goes around

  2. If you use a DOM inspector to see how Sencha Touch does icons for buttons, you can easily replicate this with your own HTML and CSS.

    Code:
    itemTpl: new Ext.XTemplate(
            '<span class="{iconCls} x-list-icon x-icon-mask"></span>',
            '{title}'
          ),
    Works for me, not sure if I also have extra CSS or not...

  3. #2
    Sencha Premium Member
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    587
    Answers
    25
    Vote Rating
    88
      0  

    Default

    If you use a DOM inspector to see how Sencha Touch does icons for buttons, you can easily replicate this with your own HTML and CSS.

    Code:
    itemTpl: new Ext.XTemplate(
            '<span class="{iconCls} x-list-icon x-icon-mask"></span>',
            '{title}'
          ),
    Works for me, not sure if I also have extra CSS or not...

Posting Permissions

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