This is a migrated thread and some comments may be shown as answers.
radalert callback
1 Answer 82 Views
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 08 Mar 2012, 05:34 PM
Hi,

Can the radalert callback function be a method on an object?  I'm trying to use the following:

myObject.callback

as the callback paramter but it doesn't work.  I have had it working when I just reference a function.

TIA

Jeff

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Mar 2012, 04:41 PM
Hi Jeff,

It is possible, I used the following code:
var myObj = new Object();
myObj.callbackTest = function (args) { alert("I was fired and the argument I got was: " + args); }
function callAlert()
{
    radalert("warning!", 300, 200, "my title", myObj.callbackTest);
}

and things worked as expected with me: http://screencast.com/t/lod1Dwh2gLB. Please make sure the object you are trying to use is available in the context of the function that calls the RadAlert and that actually the field you are passing is of type function. Please also confirm that you are using the correct syntax - i.e. that you pass all the arguments before the callback function, as this order is important.

All the best,
Marin
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.
Asked by
Jeff
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or