List 列表中的Itemtap在sencha touch2中不工作
我有根视图扩展List 列表中的Itemtap在sencha touch2中不工作,list,sencha-touch,sencha-touch-2,tap,List,Sencha Touch,Sencha Touch 2,Tap,我有根视图扩展Ext.navigation.view。我正在推一个名为additem的视图 this.push({ title:'Add Item', xtype:'additempanel' }); 从这个视图中,我再次推送一个名为“选择类别”的视图 button.up('itempanel').push({ xtype: 'selectcategorypanel', title: 'Select Category
Ext.navigation.view
。我正在推一个名为additem的视图
this.push({
title:'Add Item',
xtype:'additempanel'
});
从这个视图中,我再次推送一个名为“选择类别”的视图
button.up('itempanel').push({
xtype: 'selectcategorypanel',
title: 'Select Category'
});
我在此视图中有一个列表。但点击此列表中的某个项目会调用根视图的itemtap
我的应用程序控制器
config: {
refs: {
items :"itempanel",
SelectCategoryPanel : "selectcategorypanel"
}
'selectCategoryPanel list' : {
itemtap: 'selectCategoryItemTap'
}
'itempanel list' : {
itemtap: 'showPost'
},
始终会调用show post方法。selectCategoryPanel的项目tap从未被调用。请帮助我。您对
selectCategoryItemTap
侦听器的选择器似乎不正确。您可以通过使用视图的xtype
或通过设置指向列表的另一个ref
来修复它
按xtype
:
control: {
'selectcategorypanel list': {
itemtap: 'selectCategoryItemTap'
}
}
通过ref
:
refs: {
selectCategoryPanelList: 'selectcategorypanel list'
},
control: {
selectCategoryPanelList: {
itemtap: 'selectCategoryItemTap'
}
}
现在,
'selectCategoryPanel list'
选择器实际上没有指向Sencha可以找到的任何内容,因此它无法将侦听器附加到它。您在浏览器控制台中看到任何错误吗?现在都被调用。但真正的dat再次出现在家长面前。在child上获取空值。selectCategoryItemTap:function(list,index,element,record){console.log('Hi');selectedCategories.push(record);console.log(record);},如果您不想调用showPost()
,如果有两个单独的列表,您可能需要在选择器中更具体一些。此视图中只有一个列表。但我在根视图中有另一个列表。