This is a migrated thread and some comments may be shown as answers.

How to modify the ConfirmText RadButton property dynamically from client side?

3 Answers 240 Views
Button
This is a migrated thread and some comments may be shown as answers.
Agustin
Top achievements
Rank 2
Agustin asked on 24 Oct 2019, 04:25 PM
I need to change the ConfirmText Radbutton property when another control is changed using javascript, client-side. There are some method to get, set or remove this property from a Radbutton using javascript?

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 29 Oct 2019, 09:43 AM

Hi Agustin,

You can access the the RadConfirm button via standard jQuery and change its text in a similar way:

 

$telerik.$(".rwConfirmDialog .rwOkBtn")[0].textContent = "new OK"

 

Another possible option is to implement a custom ConfirmTemplate, so you will be able to access the defined buttons directly by ID after that:

        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <ConfirmTemplate>
                <div class="rwDialog rwConfirmDialog">
                    <div class="rwDialogContent">
                        <div class="rwDialogMessage">{1}</div>
                    </div>
                    <div class="rwDialogButtons">
                        <button id="confirmOKCancel" type="button" class="rwOkBtn" onclick="$find('{0}').close(true); return false;">##LOC[OK]##</button>
                        <button id="confirmCancelBtn" type="button" class="rwCancelBtn" onclick="$find('{0}').close(false); return false;">##LOC[Cancel]##</button>
                    </div>
                </div>
            </ConfirmTemplate>
        </telerik:RadWindowManager>

 

 

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Agustin
Top achievements
Rank 2
answered on 30 Oct 2019, 07:56 AM

Hi Vessy, thank you for your reply.

But my question is about how to modify the ConfirmText property inside the ConfirmSetting object of a RadButton

<telerik:RadButton ID="btSaveAllocation" runat="server" Text="Save" OnClick="btSetAllocationStatus_Click">
    <ConfirmSettings Title="Set End Date" ConfirmText="Are you sure you want to modify the Project Allocation Status?" />
</telerik:RadButton>
It is possible to access directly to this property using javascript?

0
Accepted
Vessy
Telerik team
answered on 30 Oct 2019, 12:57 PM

Hi,

Thank you for the clarification, Agustin. The only way to update the confirmText of RadButton from the client-side for the moment is to set it through the private functionality object of the control:

$find("btSaveAllocation")._functionality.confirmText = "new confirm text here"

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Button
Asked by
Agustin
Top achievements
Rank 2
Answers by
Vessy
Telerik team
Agustin
Top achievements
Rank 2
Share this question
or