I am working with a third party application. We have been using radFormDecorator to make it prettier on our site since it was introduced. While testing a recent update, we found that they now include a class attribute on their buttons, which means that RFD ignores it.
I would like to make a suggestion for the future that the ability to override this behavior be introduced to make it skin everything. In conjunction with DecorationZoneId, we could get an extra level of control!
In the meantime, I am trying to use jQuery to remove the class attribute on those buttons so they will be decorated, which is done with a bit of jQuery. We can see using Firebug that the class attribute gets removed... BUT it doesn't seem to get removed until after the decoration has occurred, because the buttons do not get decorated.
It is attached to ready() on the document by this script:
window.$ = $telerik.$;
$(document).ready(function() {
$("input.buttonstyle").removeAttr("class");
});
That script is included in the page:
<asp:ScriptManager runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Path="/Site/Master/Js/Controls.js" />
</Scripts>
</asp:ScriptManager>
I can see that the scripts seem to be loading in the order I need. The FormDecorator stuff
Again, upon inspection, the class does get removed, but just apparently not in time. Is there a way to ensure that some script runs before decoration occurs??
Joel
I would like to make a suggestion for the future that the ability to override this behavior be introduced to make it skin everything. In conjunction with DecorationZoneId, we could get an extra level of control!
In the meantime, I am trying to use jQuery to remove the class attribute on those buttons so they will be decorated, which is done with a bit of jQuery. We can see using Firebug that the class attribute gets removed... BUT it doesn't seem to get removed until after the decoration has occurred, because the buttons do not get decorated.
It is attached to ready() on the document by this script:
window.$ = $telerik.$;
$(document).ready(function() {
$("input.buttonstyle").removeAttr("class");
});
That script is included in the page:
<asp:ScriptManager runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Path="/Site/Master/Js/Controls.js" />
</Scripts>
</asp:ScriptManager>
I can see that the scripts seem to be loading in the order I need. The FormDecorator stuff
- Webform Postback
- MicrosoftAjax.js
- MicrosoftAjaxWebForms.js
- Core.js
- jQuery.js
- Controls.js (my script)
- FormDecorator
Again, upon inspection, the class does get removed, but just apparently not in time. Is there a way to ensure that some script runs before decoration occurs??
Joel