PDA

View Full Version : win.update problem not work- win.body.update notwork



koko2589
1 Nov 2011, 1:28 AM
I USE EXT 3
Uncaught TypeError: Object [object Object] has no method 'update'


var imgs = [
{
alt: 'Google',
img: '32/1/gif',
link: 'http://www.google.com'
}, {
alt: 'Yahoo',
img: '32/2.gif',
link: 'http://www.yahoo.com'
}
];
Ext.onReady(function()
{
var win = new Ext.Window({
title: 'Slide window', tpl: [
'<a href="{link}" target="_blank">',
'<img src="{img}" alt="{alt}">',
'</a>'
],
width: 640,
height: 400,
closeAction: 'hide',modal:'true',
buttons: [{
text: 'Close',
handler: function(){
win.hide(Ext.getBody());
}
}],
animShow: function(){
this.el.slideIn('l', {duration: 1, callback: function(){
this.afterShow(true);
}, scope: this});
},
animHide: function(){
this.el.disableShadow();
this.el.slideOut('l', {duration: 1, callback: function(){
this.el.hide();
this.afterHide();
}, scope: this});
}
});
win.show(Ext.getBody());win.update(imgs[Math.floor(imgs.length * Math.random())]);



});
TANKOU

this work but i see [object Object]
win.show(Ext.getBody());win.body.update(imgs[Math.floor(imgs.length * Math.random
())]);

mitchellsimoens
1 Nov 2011, 6:24 AM
You are using Ext JS 3 but posting in Ext JS 4... would you like me to move this for you?

You should do win.body.update, just do win.update.