2014-02-14 46 views
0

列表模板:獲取輔元件

var templ = new Ext.XTemplate(
     '<tpl if="isActive">', 
      '<div style="color:red" class="', 
      Ext.baseCSSPrefix + 'list-sortablehandle', 
      '">', 
     '</tpl>',  
    '<b>Name: {text}</b>', 
     '<tpl if="isActive">', 
      '<b>{text}</b></div>', 
     '</tpl>', 
      { 
       // XTemplate configuration: 
       compiled: true, 
       // member functions: 
       isitem2: function (name) { 
        return name == 'item2'; 
       }, 
      } 
); 

我可以能夠使用

var targetItem = list.getItemAt(targetIndex); 

targetItem.down('.x-list-sortablehandle') 

獲得從具體指標列表項通過預期

對象的翻譯:有沒有方法「向下」

我想知道在目前listmItem

回答

1

話getItemAt內的特定元素是否可能返回SimpleListItem(假設你不進行任何設置自定義),它沒有down方法。你可能想要做的就是從中獲取元素,而不是targetItem.down嘗試使用targetItem.element.down