Molamini
17 Mar 2009, 11:28 AM
Hello,
I have searched through the forums trying to find a way to 'refresh' or 'update' the display of a Panel object. The code below is an example of me trying to do such a thing and failing.
Any suggestions?
Thanks!!!
Molamini
var SillyClass = function(config)
{
Ext.apply(this,
{
width: 300,
height: 300
});
SillyClass.superclass.constructor.apply(this, arguments);
this.value = config.value || 0;
}
Ext.extend(SillyClass, Ext.Panel,
{
onRender: function(e)
{
SillyClass.superclass.onRender.apply(this, arguments);
this.html=" value:" + this.value;
},
///vvvvvvvvvvvvv problem in this method vvvvvvvvvvvvvvvvvvv
setValue: function(value)
{
this.value = value;
//how do I force an onRender?
this.getEl().getUpdater().refresh();
;
}
///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
});
Ext.onReady(function()
{
var sillyClass = new SillyClass(
{
title:'SillyClass 1',
renderTo: document.body,
width: 300,
height: 300,
value: 7
});
Ext.Msg.alert(sillyClass.value);
sillyClass.setValue(30);
// never have 2 consecutive alerts
// -- the thread does not block.
Ext.Msg.alert(sillyClass.value);
});
I have searched through the forums trying to find a way to 'refresh' or 'update' the display of a Panel object. The code below is an example of me trying to do such a thing and failing.
Any suggestions?
Thanks!!!
Molamini
var SillyClass = function(config)
{
Ext.apply(this,
{
width: 300,
height: 300
});
SillyClass.superclass.constructor.apply(this, arguments);
this.value = config.value || 0;
}
Ext.extend(SillyClass, Ext.Panel,
{
onRender: function(e)
{
SillyClass.superclass.onRender.apply(this, arguments);
this.html=" value:" + this.value;
},
///vvvvvvvvvvvvv problem in this method vvvvvvvvvvvvvvvvvvv
setValue: function(value)
{
this.value = value;
//how do I force an onRender?
this.getEl().getUpdater().refresh();
;
}
///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
});
Ext.onReady(function()
{
var sillyClass = new SillyClass(
{
title:'SillyClass 1',
renderTo: document.body,
width: 300,
height: 300,
value: 7
});
Ext.Msg.alert(sillyClass.value);
sillyClass.setValue(30);
// never have 2 consecutive alerts
// -- the thread does not block.
Ext.Msg.alert(sillyClass.value);
});