Completed
Last Updated: 19 Oct 2020 08:27 by ADMIN
Release R3 2020 SP1
Narendra
Created on: 14 Sep 2020 09:41
Category: UI for ASP.NET AJAX
Type: Feature Request
0
RadComboBox integration with RadLabel

Currently, the asp:Label and telerik:RadLabel are rendering the AssociatedControlID of the ComboBox as for="RadComboBox1" while it should be for="RadComboBox1_Input"

FROM ADMIN:

1) Use Sys.Application.Load event to fix all labels associated with RadComboBoxes: 

<script type="text/javascript">
    function fixLabelFor() {
        $telerik.$("label[for]").each(function () {
            var lbl = $telerik.$(this)
            if ($telerik.$("#" + lbl.attr("for")).hasClass("RadComboBox")) {
                lbl.attr("for", lbl.attr("for") + "_Input");
            }
        })
        // Sys.Application.remove_load(fixLabelFor); 
    }
    Sys.Application.add_load(fixLabelFor);
</script>


2) Use OnClientLoad of the ComboBox you want to apply the fix to:
<script>
    function OnClientLoad(sender, args) {
        var ariasettings = JSON.parse(sender._ariaSettings)
        if (ariasettings && ariasettings["aria-describedby"]) {
            var lbl = $get(ariasettings["aria-describedby"]);
            lbl.setAttribute("for", lbl.getAttribute("for") + "_Input")
        }
    }
</script>

0 comments