radalert callback

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    2 posts
    Member since:
    Oct 2011

    Posted 08 Mar 2012 Link to this post


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


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


  2. Marin Bratanov
    Marin Bratanov avatar
    5811 posts

    Posted 09 Mar 2012 Link to this post

    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,
    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.
Back to Top