动画(滑入)新面板以替换当前面板的内容?
我正在尝试更改 Ext.List
的内容。我正在尝试将内容更改为新面板,尽管我不需要更多列表元素。
这似乎替换了内容,但如何为更改设置动画?
onItemDisclosure: function(record, btn, index) {
console.log('Disclose more info for ' + record.get('name'));
var panel1 = Ext.getCmp('panel-1');
panel1.remove(Ext.getCmp('panel-1'));
panel1.add(Ext.getCmp('panel-2'));
panel1.doLayout();
}
I'm trying to change the contents of an Ext.List
. I'm trying to change the content to a new panel, although I don't need more list elements.
This seems to replace the contents, but how do I animate the change?
onItemDisclosure: function(record, btn, index) {
console.log('Disclose more info for ' + record.get('name'));
var panel1 = Ext.getCmp('panel-1');
panel1.remove(Ext.getCmp('panel-1'));
panel1.add(Ext.getCmp('panel-2'));
panel1.doLayout();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好的方法是将
panel-1
和panel-2
作为不同面板中的项目,然后在它们之间切换。示例:然后您可以像这样
Ext.getCmp('detailPanel').update(record.data);
更新detailPanel并切换到它。Ext.getCmp('thePanel').setActiveItem(1,{type:'slide',direction:'left'});
setActiveItem 的第二个参数是动画配置。目的。 http://dev.sencha.com/deploy/touch/docs/ ?class=Ext.Panel
The best is to have the
panel-1
andpanel-2
as items in a different panel and then switch between them. Example:Then you can update the detailPanel like this
Ext.getCmp('detailPanel').update(record.data);
and switch to it.Ext.getCmp('thePanel').setActiveItem(1,{type:'slide',direction:'left'});
The second argument of the setActiveItem is the animation config. object. http://dev.sencha.com/deploy/touch/docs/?class=Ext.Panel