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

RadListBox Delete with RadConfirm

2 Answers 182 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Anatoliy
Top achievements
Rank 2
Anatoliy asked on 08 Nov 2012, 10:02 AM
Hello Telerik team,

I have Delete logic on server side & want to use radconfirm. Prompt me how I can turn from java script method RadListBox1Deleted!

function RadListBox1Deleting(sender, arg) {
             var callBackFunction = Function.createDelegate(sender, function (shouldSubmit) {
                 if (shouldSubmit) {
                     // call server side RadListBox1Deleted
                 }
             });
             var text = "Are you sure you want to delete?";
             radconfirm(text, callBackFunction, 300, 100, null, "Deleting");
             arg.set_cancel(true);
         }

2 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 13 Nov 2012, 08:31 AM
Hi Anatoliy,

Please consider the following implementation, in order to call the server side event Deleted:
<script type="text/javascript">
       function RadListBox1Deleting(sender, arg) {
           var callBackFunction = Function.createDelegate(sender, function (shouldSubmit) {
               if (shouldSubmit) {
                   sender.postback({ type: Telerik.Web.UI.ListBoxCommand.Delete });
               }
           });
           var text = "Are you sure you want to delete?";
           radconfirm(text, callBackFunction, 300, 100, null, "Deleting");
           arg.set_cancel(true);
       }
   </script>



Greetings,
Nencho
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Anatoliy
Top achievements
Rank 2
answered on 15 Nov 2012, 08:51 AM
Hi Nencho, Thanks a lot!
Tags
ListBox
Asked by
Anatoliy
Top achievements
Rank 2
Answers by
Nencho
Telerik team
Anatoliy
Top achievements
Rank 2
Share this question
or