Hello Polaris431,
Thank you for contacting Telerik support.
This problem is due to the browser behaviour, rather than to the RadToolbar. When a Toolbar Button is disabled no other actions can be performed on this button. Therefore the disabled css class can not be applied and the button remains in its last condition (in your case - visually hovered).
You could try applying the css properties for a disabled Toolbar Button right before disabling it like this:
| function disableToolbarButton(toolbarButton) |
| { |
| var toolbarButtonDiv = document.getElementById(toolbarButton.ClientID); |
| |
| toolbarButtonDiv.style.filter = "alpha(opacity='40')"; |
| toolbarButtonDiv.style.opacity = "0.4"; |
| toolbarButtonDiv.style.background = "none"; |
| |
| var image = document.getElementById("img_" + sender.ClientID); |
| |
| image.style.background = "none"; |
| |
| sender.Enabled = false; |
| } |
When you wish to enable the Toolbar Button you should apply its normal css style again like this:
| function enableButton(toolbarButton) |
| { |
| toolBarButton.Enabled = true; |
| |
| var toolbarButtonDiv = document.getElementById(toolbarButton.ClientID); |
| |
| toolbarButtonDiv.style.filter = ""; |
| toolbarButtonDiv.style.opacity = ""; |
| toolbarButtonDiv.style.background = 'transparent url("Img/toolbarBgHover.gif") no-repeat top right'; |
| |
| var image = document.getElementById("img_" + toolBarButton.ClientID); |
| |
| image.style.background = 'transparent url("Img/toolbarButtonOver.gif") no-repeat top left'; |
| } |
I hope this helps.
All the best,
Simon
the Telerik team