2011-05-20 48 views
0

你好任何人都可以告訴ho在商店中選擇一個字段 我做了一個嵌套列表,當有人點擊一個葉子時,我想要一些哎呀,你點擊一片葉子。葉是一個布爾字段。 這是我所:選擇店裏的一個字段

 new Ext.NestedList({ 
      title: 'Categorieën', 
      store: NestedListDemo.Groepen_Store, 
      flex: 1, 
      listeners: 
       { 
       itemtap: function(item) 
        { 
         if (leaf==true) 
         { 
         Ext.Msg.alert('Oops', 'leaf clicked', Ext.emptyFn); 
         } 
        } 
       } 
     }), 

,但我不知道怎麼做,與煎茶觸摸。

回答

0

我有點困惑這個葉屬性存在的地方。如果查看NestedList的文檔,您將看到該列表將觸發一個itemtapleafitemtap事件。我的建議是使用leafitemtap只在葉子上的項目上獲得事件。

所以,如果你使用該功能改變你的代碼:

listeners:{ 
    leafitemtap: function(sublist, index, element, event, card){ 
     Ext.Msg.alert('Oops', 'leaf clicked', Ext.emptyFn); 
     //find the item 
     var item = sublist.store.getAt(index); 
     //then you can do something with the item 
     //item.get('leaf') 
     //sublist.store.remove(item) 
    } 

} 
相關問題