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

set event argument OnResponseEnd

1 Answer 66 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Bogice
Top achievements
Rank 1
Bogice asked on 05 Oct 2010, 04:23 AM
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,

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 07 Oct 2010, 02:57 PM
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
Tags
Ajax
Asked by
Bogice
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or