MVCxClientVerticalGrid.PerformCallback(data) Method
Sends a callback with a parameter to update the VerticalGrid by processing the passed information on the server in an Action specified via the grid’s GridSettingsBase.CustomActionRouteValues property.
Declaration
PerformCallback(
data: any,
onSuccess?: (arg: string) => void
): void
Parameters
Name | Type | Description |
---|---|---|
data | any | An object containing any information that needs to be passed to a handling Action specified via the grid’s GridSettingsBase.CustomActionRouteValues property. |
onSuccess | (arg: string) => void | A client action to perform if the server round-trip completed successfully. |
Remarks
Use the PerformCallback method if you need to dynamically update the VerticalGrid by asynchronously going to the server (using AJAX-based callback technology) and performing server-side processing in the specified Action. Via the PerformCallback method’s data parameter, you can pass any information collected on the client to the server for further server processing. The onSuccess parameter allows you to specify a client function that should be executed after the server round-trip completed successfully.
The PerformCallback method posts back to the server using the callback technology and is handled in an Action specified by the grid’s GridSettingsBase.CustomActionRouteValues property. Any data passed via the method’s data parameter can be accessed on the server as a parameter of the specified Action. So, the necessary server-side actions can be performed in the handling Action based upon the value(s) passed from the client.
For instance, you can pass values as a hash table.
Client Script Code:
myVerticalGrid.PerformCallback({key1: value}, OnSuccess);
function OnSuccess() {
...
}
Controller Code:
ActionResult MyAction(int key1){
...
}
The VerticalGrid automatically updates itself (it is re-rendered) after a custom callback has been sent and processed on the server.
If you need to perform a custom callback to the server without updating the VerticalGrid, you can send it via the client MVCxClientVerticalGrid.GetValuesOnCustomCallback method and handle it in an Action specified via the GridSettingsBase.CustomDataActionRouteValues property.
If you need to perform actions on the client-side before and after callback processing, handle the MVCxClientVerticalGrid.BeginCallback and ASPxClientVerticalGrid.EndCallback events.