Unplanned
Last Updated: 19 May 2022 12:04 by ADMIN
Mike
Created on: 19 May 2022 11:53
Category: ToggleButton
Type: Bug Report
1
Icons in RadToggleButton disappear when using ConfirmSettings

Set up to reproduce:

<telerik:RadToggleButton ID="RadToggleButton1" runat="server" Text="RadToggleButton">
        <ConfirmSettings ConfirmText="Sure?" />
    <ToggleStates>
        <telerik:ButtonToggleState Text="state1">
            <Icon Url="supervisorIcon.png" />
        </telerik:ButtonToggleState>
        <telerik:ButtonToggleState Text="state2">
            <Icon Url="ownerIcon.jfif" />
        </telerik:ButtonToggleState>
    </ToggleStates>
</telerik:RadToggleButton>

1 comment
ADMIN
Doncho
Posted on: 19 May 2022 12:04

As a workaround you can validate the action manually by canceling the On:

  • With window.confirm():
    <script>
       function clientClicking(sender, args) {
            args.set_cancel(!window.confirm("Sure?"));
        }
    </script>
    
    <telerik:RadToggleButton ID="RadToggleButton1" runat="server" Text="RadToggleButton" OnClientClicking="clientClicking">
        <ToggleStates>
            <telerik:ButtonToggleState Text="state1">
                <Icon Url="supervisorIcon.png" />
            </telerik:ButtonToggleState>
            <telerik:ButtonToggleState Text="state2">
                <Icon Url="ownerIcon.jfif" />
            </telerik:ButtonToggleState>
        </ToggleStates>
    </telerik:RadToggleButton>
  • With radconfirm():
    <script>
        var preventCommand = true;
        var button;
    
        function clientClicking(sender, args) {
            button = sender;
            if (preventCommand) {
                args.set_cancel(preventCommand);
                radconfirm("Sure?", confirmCallBackFn, 300, 200, null, "Confirm");
            }
        }
    
        function confirmCallBackFn(arg) {
            if (arg) {
                preventCommand = false;
                button.click();
            }
        }
    </script>
    
    <telerik:RadWindowManager runat="server" ID="RadWindowManager"></telerik:RadWindowManager>
    
    <telerik:RadToggleButton ID="RadToggleButton1" runat="server" Text="RadToggleButton" OnClientClicking="clientClicking">
        <ToggleStates>
            <telerik:ButtonToggleState Text="state1">
                <Icon Url="supervisorIcon.png" />
            </telerik:ButtonToggleState>
            <telerik:ButtonToggleState Text="state2">
                <Icon Url="ownerIcon.jfif" />
            </telerik:ButtonToggleState>
        </ToggleStates>
    </telerik:RadToggleButton>