PDA

View Full Version : [FIXED][3.0.0] StatusBar clearStatus operates on wrong property



mjlecomte
15 Jul 2009, 8:20 AM
Ext version tested:

Ext 3.0.0 rev 4824


Adapter used:

ext


Browser versions tested against:

FF3 (firebug 1.3.0.10 installed)


Operating System:

WinXP Pro


Description:

The render phase of StatusBar has changed between 2.x and 3.x where this.statusEl formerly was an Ext.Element where now it's a Toolbar item. As a result some of the operands on this.statusEl need to be updated accordingly.


Test Case:



Ext.onReady(function(){

new Ext.StatusBar({
id: 'my-status',
renderTo: document.body,
width: 500,

// defaults to use when the status is cleared:
defaultText: 'Default status text',
defaultIconCls: 'default-icon',

// values to set initially:
text: 'Ready',
iconCls: 'ready-icon',

// any standard Toolbar items:
items: [
{
text: 'set status as OK',
handler: function (){
// Update the status bar later in code:
var sb = Ext.getCmp('my-status');
sb.setStatus({
text: 'OK',
iconCls: 'ok-icon',
clear: true // auto-clear after a set interval
});
}
},
{
text: 'show Busy',
handler: function (){
// Update the status bar later in code:
var sb = Ext.getCmp('my-status');
// Set the status bar to show that something is processing:
sb.showBusy();
}
},
{
text: 'clear status',
handler: function (){
// Update the status bar later in code:
var sb = Ext.getCmp('my-status');
sb.clearStatus(); // once completeed
}
},
'-',
'Plain Text'
]
});
});



Steps to reproduce the problem:

Click on the red highlighted button ('set status as OK') and wait


The result that was expected:

The default text should show up after 5 seconds


The result that occurs instead:

An error for a missing function


Screenshot or Video:

none


Debugging already done:

described herein


Possible fix:



clearStatus : function(o){
o = o || {};

if(o.threadId && o.threadId !== this.activeThreadId){
// this means the current call was made internally, but a newer
// thread has set a message since this call was deferred. Since
// we don't want to overwrite a newer message just ignore.
return this;
}

var text = o.useDefaults ? this.defaultText : '',
iconCls = o.useDefaults ? (this.defaultIconCls ? this.defaultIconCls : '') : '';

if(o.anim){
// animate the statusEl Ext.Element
this.statusEl.el.fadeOut({
remove: false,
useDisplay: true,
scope: this,
callback: function(){
this.setStatus({
text: text,
iconCls: iconCls
});

this.statusEl.el.show();
}
});
}else{
// hide/show the el to avoid jumpy text or icon
this.statusEl.hide();
this.setStatus({
text: text,
iconCls: iconCls
});
this.statusEl.show();
}
return this;
},

mjlecomte
15 Jul 2009, 8:32 AM
Additionally, since StatusBar is an "ux" references to it within resources\css are not appropriate.

I find references at

resources\css\visual\toolbar.css
resources\css\structure\toolbar.css
resources\css\xtheme-gray.css


Any css for this class should be handled through:
examples\ux\css\StatusBar.css
which should presumably be split into structure and visual files accordingly.

mjlecomte
15 Jul 2009, 9:17 AM
Some of the css needs to be tweaked as well since the statusBar is now just a toolbar item:



/* StatusBar - structure */
.x-statusbar .x-status-text {
cursor: default;
/*
height: 21px;
line-height: 21px;
padding: 0 4px;
*/
}
.x-statusbar .x-status-busy {
padding-left: 25px !important;
background: transparent no-repeat 3px 2px;
}

mjlecomte
15 Jul 2009, 2:16 PM
A tentative fix for this report has been applied to the trunk via rev 4828.

Maxrunner
17 Jul 2009, 2:08 AM
A tentative fix for this report has been applied to the trunk via rev 4828.
sorry to ask but how do i have acess to ext trunk?or it isnt acessable to normal users?

regards,

mjlecomte
17 Jul 2009, 3:30 AM
sorry to ask but how do i have acess to ext trunk?or it isnt acessable to normal users?

regards,

http://extjs.com/forum/showthread.php?p=341946#post341946