Sencha touch 如何在sencha touch中从通用主页滑动到嵌套列表布局
我开始使用sencha touch。我已经能够创建一个nestedlist布局,在其中单击叶元素会触发getdetailcard。现在我想做一些和之相反的事情 我想现在创建一个主页上没有任何东西,但它的标志。当用户单击徽标时,布局将滚动到嵌套的项目列表 有人能给我指一下相关文档或给我看一下示例代码吗Sencha touch 如何在sencha touch中从通用主页滑动到嵌套列表布局,sencha-touch,nested-lists,Sencha Touch,Nested Lists,我开始使用sencha touch。我已经能够创建一个nestedlist布局,在其中单击叶元素会触发getdetailcard。现在我想做一些和之相反的事情 我想现在创建一个主页上没有任何东西,但它的标志。当用户单击徽标时,布局将滚动到嵌套的项目列表 有人能给我指一下相关文档或给我看一下示例代码吗 谢谢您需要将面板卡添加到视口中,然后在徽标上点击“更改活动项” 以下是示例代码: var data = { text: 'Groceries', items: [{
谢谢您需要将面板卡添加到视口中,然后在徽标上点击“更改活动项” 以下是示例代码:
var data = {
text: 'Groceries',
items: [{
text: 'Drinks',
items: [{
text: 'Water',
items: [{
text: 'Sparkling',
leaf: true
}]
}]
}]
};
Ext.regModel('ListItem', {
fields: [{name: 'text', type: 'string'}]
});
var store = new Ext.data.TreeStore({
model: 'ListItem',
root: data,
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
}
});
var nestedList = new Ext.NestedList({
title: 'Groceries',
displayField: 'text',
store: store
});
var MyApp = new Ext.Application({
name: 'MyApp',
launch: function() {
MyApp.views.viewport = new Ext.Panel({
fullscreen: true,
layout: 'card',
cardAnimation: 'slide',
items: [
{
xtype: 'panel',
html:'<img src="https://www.google.com/intl/en_com/images/srpr/logo3w.png">',
listeners:{
el:{tap:function(){MyApp.views.viewport.setActiveItem(1,{type:'slide',direction:'left'});}}
}
},
nestedList
]
});
}
});
var数据={
文字:“杂货店”,
项目:[{
文字:“饮料”,
项目:[{
文字:“水”,
项目:[{
文字:“闪闪发光”,
叶:是的
}]
}]
}]
};
Ext.regModel('ListItem'{
字段:[{name:'text',type:'string'}]
});
var store=new Ext.data.TreeStore({
模型:“ListItem”,
根:数据,
代理:{
键入:“ajax”,
读者:{
键入:“树”,
root:'项目'
}
}
});
var nestedList=new Ext.nestedList({
标题:“食品杂货”,
显示字段:“文本”,
商店:商店
});
var MyApp=新的外部应用程序({
名称:“MyApp”,
启动:函数(){
MyApp.views.viewport=新建外部面板({
全屏:对,
布局:“卡片”,
cardAnimation:“幻灯片”,
项目:[
{
xtype:'面板',
html:“”,
听众:{
el:{tap:function(){MyApp.views.viewport.setActiveItem(1,{类型:'slide',方向:'left'});}
}
},
嵌套列表
]
});
}
});
您需要将面板卡添加到视口中,然后在徽标上点击更改活动项
以下是示例代码:
var data = {
text: 'Groceries',
items: [{
text: 'Drinks',
items: [{
text: 'Water',
items: [{
text: 'Sparkling',
leaf: true
}]
}]
}]
};
Ext.regModel('ListItem', {
fields: [{name: 'text', type: 'string'}]
});
var store = new Ext.data.TreeStore({
model: 'ListItem',
root: data,
proxy: {
type: 'ajax',
reader: {
type: 'tree',
root: 'items'
}
}
});
var nestedList = new Ext.NestedList({
title: 'Groceries',
displayField: 'text',
store: store
});
var MyApp = new Ext.Application({
name: 'MyApp',
launch: function() {
MyApp.views.viewport = new Ext.Panel({
fullscreen: true,
layout: 'card',
cardAnimation: 'slide',
items: [
{
xtype: 'panel',
html:'<img src="https://www.google.com/intl/en_com/images/srpr/logo3w.png">',
listeners:{
el:{tap:function(){MyApp.views.viewport.setActiveItem(1,{type:'slide',direction:'left'});}}
}
},
nestedList
]
});
}
});
var数据={
文字:“杂货店”,
项目:[{
文字:“饮料”,
项目:[{
文字:“水”,
项目:[{
文字:“闪闪发光”,
叶:是的
}]
}]
}]
};
Ext.regModel('ListItem'{
字段:[{name:'text',type:'string'}]
});
var store=new Ext.data.TreeStore({
模型:“ListItem”,
根:数据,
代理:{
键入:“ajax”,
读者:{
键入:“树”,
root:'项目'
}
}
});
var nestedList=new Ext.nestedList({
标题:“食品杂货”,
显示字段:“文本”,
商店:商店
});
var MyApp=新的外部应用程序({
名称:“MyApp”,
启动:函数(){
MyApp.views.viewport=新建外部面板({
全屏:对,
布局:“卡片”,
cardAnimation:“幻灯片”,
项目:[
{
xtype:'面板',
html:“”,
听众:{
el:{tap:function(){MyApp.views.viewport.setActiveItem(1,{类型:'slide',方向:'left'});}
}
},
嵌套列表
]
});
}
});