煎茶触摸列表视图连续翻番后退按钮问题 [英] Sencha Touch consecutive listviews double back buttons issue
问题描述
上面的图片显示我的煎茶触摸应用程序的现有结构。我的个人资料页结束了2后退按钮,因为用户经过2列表视图去详细信息视图。
The image above shows the current structure of my Sencha Touch app. My details pages end up with 2 back buttons because a user goes through 2 listviews to get to the details view.
我要寻找一个解决方案,将会把一个单一的后退按钮上的详细信息视图可以追溯到空缺列表。而空缺名单将有它自己的后退按钮可以追溯到的章节列表中。
任何人都可以请帮我这个?
Can anyone please help me with this?
推荐答案
使用的Ext.navigation.View。这将处理所有的视图过渡,并会为您创建一个后退按钮。所有你所要做的就是推你的清单内容。
Use an Ext.navigation.View. It will handle all the view transitions and will create a back button for you. All you have to do is pushing your lists into it.
Ext.create("Controller", {
extend: "Ext.app.Controller",
refs: {
navigationView: "navigationview",
sectionList: "list[itemId='sectionlist']",
vacancyList: "list[itemId='vacancylist']"
},
control: {
sectionList: {
sectionSelected: "handleSectionSelection"
},
vacancyList: {
vacancySelected: "handleVacancySelection"
}
},
handleSectionTap: function () {
var sectionList = Ext.create("Ext.List", {
itemId: "sectionlist",
store: "sectionStore",
itemTpl: "{name}",
onItemDisclosure: function ( list, record ) {
this.fireEvent( "sectionSelected", record );
}
});
var navigationView = this.getNavigationView();
navigationView.push( sectionList );
},
handleSectionSelection: function ( record ) {
var vacancyList = Ext.create("Ext.List", {
itemId: "vacancylist",
store: record.get("storeId"),
itemTpl: "{name}",
onItemDisclosure: function ( list, record ) {
this.fireEvent( "vacancySelected", record );
}
});
},
handleVacancySelection: function ( record ) {
var detailView = Ext.create("DetailView");
detailView.setRecord( record );
var navigationView = this.getNavigationView();
navigationView.push( detailView );
}
});
在选择列表中披露按钮抽头将推动新的空缺列表进入导航视图。现在既然上有两种观点navigationview叠它会创建一个后退按钮,这将因为一次弹出列表空缺,并返回到选择列表中。
A tap on a disclosure button of the selection list will push a new vacancy list into the navigation view. Since there are now two views on the navigationview stack it will create a back button which will let one pop the vacancy list and return to the selection list.
同样的程序。
在code假定您已经创建了一个导航视图的地方,并且选择记录保存的空缺商店的ID。
The code assumes that you have already created a navigation view somewhere and that your selection record holds an id of the an vacancy store.
这篇关于煎茶触摸列表视图连续翻番后退按钮问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!