2011-05-20 44 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) 
    } 

} 
相关问题