set event argument OnResponseEnd

2 posts, 0 answers
  1. Bogice
    Bogice avatar
    30 posts
    Member since:
    Dec 2009

    Posted 04 Oct 2010 Link to this post

    Hi,
    Could you provide an examples how can I set the event argument to eventArgs parameter of OnRespondEnd. Basically, i have an ajaxified RadGrid through RadAjaxManager. After adding an entry to this grid, i need to carry this new entry's id to do some other operations on client side. So the function OnResponseEnd look like this
    function OnResponseEnd(sender, eventArgs)
    {
    if (eventArgs.get_eventTarget() == "grdProjectTask$ctl00$ctl02$ctl01$btnUpdate")
      {
       var taskId = eventArgs.get_eventArgument();
                        AddAlertToNewTask(taskId)
      }
     
      }

    I need the taskId in the function OnResponseEnd. Do i need to inject somewhere in ItemCommand of the Grid so that after "Insert" an entry, OnResponseEnd will have it's id.
    Thank you,
  2. Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 07 Oct 2010 Link to this post

    Hi Bogice,

    I am not sure if I completely understand your enquiry. The event argument carried by eventArgs in OnResponseEnd is the string passed in the initial AJAX request.

    Do you want to keep it, so you can use it in subsequent javascript methods during the same page's lifecycle or you want to preserve it upon postbacks? If it is the first scenario, you can just keep this argument in a variable which is outside of the current javascript handler. If it is the second one, you can keep it in a hidden field on the page.

    Sincerely yours,
    Tsvetina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top