PDA

View Full Version : reset a toolbar button



michaelc
26 May 2009, 7:22 PM
how do I reset a clicked toolbar button ?
I expected toggle would do it.

I don't see it in the API.


tbar : [{
text : 'Screen refresh',
id : 'eAdminNotificationGrid.tbar.refresh',
scope : this,
handler : function (){
eAdminNotificationStore.load({params:{actionType:'NotificationStatus'}});
}
},{ text : 'Notification reset',
id : 'eAdminNotificationGrid.tbar.reset',
scope : this,
handler : function (){
Ext.getCmp("eAdminNotificationGrid.tbar.reset").toggle(false),
Ext.Ajax.request({
url: this.phpFile,
success: this.successMessageFn(eAdminNotificationStore),
failure: this.faileMessageFn,
params: {actionType:'NotificationReset'}
})
}
}]

karieanis
26 May 2009, 8:00 PM
You need to set enableToggle in your button config. In addition to that, you would need to add a toggleHandler function to determine what action occurs when the state changes.

michaelc
27 May 2009, 10:57 AM
Maybe I am missing something,
when the user clicks the toolbar button it shows the button like this
http://www.turningpointtech.com/resetbutton.gif

now I click anywhere else and it returns to the standard state.
I looked over the API is this reset via a toggle event ?

how do I remove the lines when the process has occured ?

incaic
29 May 2009, 1:35 AM
how do I remove the lines when the process has occured ?

These dotted lines are from the FF browser, not EXTJS.
I don't know if there is a way to remove it. Saw this
when I searched for an answer, though.

http://stackoverflow.com/questions/71074/how-to-remove-firefoxs-dotted-outline-on-buttons-as-well-as-links

Let everyone know if it works.

michaelc
5 Jun 2009, 6:31 AM
These dotted lines are from the FF browser, not EXTJS.
I don't know if there is a way to remove it. Saw this
when I searched for an answer, though.

http://stackoverflow.com/questions/71074/how-to-remove-firefoxs-dotted-outline-on-buttons-as-well-as-links

Let everyone know if it works.

Thanks not the answer I needed, once I had my brain think about it, it was simple.
once the process is completed I just removed focus from the component