Telerik rad Note 1

Source: Internet
Author: User

1. Click "OK" for the radtoolbar client implementation.

Add onclientbuttonclicking = "clientbuttonclicking" to radtoolbar"

Then confirm in the script

Function clientbuttonclicking (sender, argS)
{
If (ARGs. get_item (). get_text () = "Report ")
{
If (! Window. Confirm ("are you sure you want to report? The reported data cannot be modified! "))
{
Args. set_cancel (true );
}
}
}

 

2. radgrid implementation prompt on the client

Set in radgrid

<Clientsettings>
<Clientevents oncommand = "onclientbuttonclicking"/>
</Clientsettings>

 

Add script

<Telerik: radcodeblock id = "radcodeblock1" runat = "server">

<SCRIPT type = "text/JavaScript">
<! --
Function onclientbuttonclicking (sender, argS)
{
If (ARGs. get_commandname () = "delete ")
{
VaR grid = $ find ("<% = radgrid1.clientid %> ");
VaR view = $ find ("<% = radgrid1.mastertableview. clientid %> ");
VaR items = view. get_dataitems ();
VaR item = items [args. get_commandargument ()];

// Usercount must be the primary key. If usercount is not the primary key of the table, set clientdatakeynames in the grid as the composite primary key.

// For example, clientdatakeynames = "ID, usercount"
VaR usercount = item. getdatakeyvalue ("usercount ");
If (usercount> 0)
{
Alert ("a user is using this role and cannot delete it. ");
Args. set_cancel (true );
}
}
}
-->
</SCRIPT>

</Telerik: radcodeblock>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.