//两个Panel之间相互跳转的例子
Ext.application( {
fullscreen : true,
name : 'pagedump',
// 名字空间
launch : function() {
// 第一个panel
var firstPanel = Ext.create('Ext.Panel', {
fullscreen : true,
id : 'firstPanel',
items : [ {
xtype : 'button',
text : '下一页',
width : '20%',
height : '7%',
handler : function() {
Ext.Viewport.animateActiveItem(1, {
type : 'slide',
direction : 'right'
});
}
} ]
});
// 第二个Panel
var secondPanel = Ext.create('Ext.Panel', {
fullscreen : true,
id : 'secondPanel',
items : [ {
xtype : 'button',
text : '上一页',
width : '20%',
height : '7%',
left : '30%',
handler : function() {
Ext.Viewport.animateActiveItem(0, {
type : 'slide',
direction : 'left'
});
}
} ]
});
Ext.Viewport.add( [ firstPanel, secondPanel ]);
}
});
Ext.application( {
fullscreen : true,
name : 'pagedump',
// 名字空间
launch : function() {
// 第一个panel
var firstPanel = Ext.create('Ext.Panel', {
fullscreen : true,
id : 'firstPanel',
items : [ {
xtype : 'button',
text : '下一页',
width : '20%',
height : '7%',
handler : function() {
Ext.Viewport.animateActiveItem(1, {
type : 'slide',
direction : 'right'
});
}
} ]
});
// 第二个Panel
var secondPanel = Ext.create('Ext.Panel', {
fullscreen : true,
id : 'secondPanel',
items : [ {
xtype : 'button',
text : '上一页',
width : '20%',
height : '7%',
left : '30%',
handler : function() {
Ext.Viewport.animateActiveItem(0, {
type : 'slide',
direction : 'left'
});
}
} ]
});
Ext.Viewport.add( [ firstPanel, secondPanel ]);
}
});