我正在尝试更改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();
}发布于 2011-09-28 14:26:35
最好是将panel-1和panel-2作为项目放在不同的面板中,然后在它们之间进行切换。示例:
var detailPanel = new Ext.Panel({
fullscreen: true,
id:'detailPanel',
scroll:'vertical',
tpl:'<h1>{text}</h1>'
});
var list = new Ext.List({
id :'theList',
itemTpl : '{firstName} {lastName}',
store: store1,
width: '100%',
scroll:false
});
var panel = new Ext.Panel({
fullscreen: true,
id:'thePanel',
layout: 'card',
cardSwitchAnimation:'slide',
scroll:'vertical',
items:[list, detailPanel]
});然后,您可以像下面的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
https://stackoverflow.com/questions/7577729
复制相似问题