How to use radconfirm from JavaScript?
Functions radalert or radconfirm not defined. Could someone please show me the sample?
for example when I call this function I get radalert is undefined:
function testWnd() {
radalert("Confirm returned the following result: " + arg);
}
Please follow the below steps to achieve the radalert functionality from the client side:
Step 1: Markup.
On your web page please include an instance of RadWindowManager. Without this radalert, radconfirm or radprompt wont work. This is the backbone of this feature. Here is the code snippet:
Next place a normal button and handle its onclick event. Here is the code snippet:
notice the callback for the radlalert named “alertCallBackFn”. We will code that function in next section. Also note the use of the variable imgUrl variable. This defines the image to be used in the radalert. We will see what it does in the next section.
Step 2: Javscript
The radalert needs a image to be shown as part of the alert window. Declare a global variable by name “imgUrl” as below:
Then create the radalert call back function as below:
Now when you click on the radalert button, you will see the alert box being shown with your text.
Hope this was the solution you were looking for.
Lohith (Tech Evangelist, Telerik India)