【问题标题】:Sencha Touch Extjs itemTpl # inside if tagSencha Touch Extjs itemTpl # inside if 标签
【发布时间】:2014-08-22 15:49:59
【问题描述】:

如何在 ITEMTPL 的 IF 标记中使用 {#}?

假设我想为我的 itemTpl 中的第一项做一些不同的事情,我认为其中一些应该可行:

'<tpl if="# &lt; 1">',  // NOT WORKING

'<tpl if="{#} &lt; 1">', // NOT WORKING

'<tpl if="\'#\' &lt; 1">', // NOT WORKING

虽然我能做到:

itemTpl : '{x}' //print indexes

【问题讨论】:

  • 这个问题可能和这个类似:stackoverflow.com/q/10075394/814416
  • 事实上并非如此。因为您提到的问题表明他无法获得列表的索引。我确实得到了索引(我猜 Sencha 做了一些更新),但在 if 标记内不起作用。

标签: extjs sencha-touch


【解决方案1】:

是的

<tpl if="xindex === 0"> Only show in first item </tpl>

http://docs.sencha.com/touch/2.3.1/#!/api/Ext.XTemplate

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-10
    • 1970-01-01
    相关资源
    最近更新 更多