Skip to main content
All docs
V23.2

ASPxClientGantt.PerformCallback(args) Method

Sends a callback to the server and raises the server-side CustomCallback event.

Declaration

PerformCallback(
    args: string,
    onSuccess?: (arg: string) => void
): void

Parameters

Name Type Description
args string

Information to pass to the CustomCallback event.

onSuccess (arg: string) => void

A client action to perform if the Gantt control successfully completes the round trip to the server.

Remarks

Call the PerformCallback method to perform server-side actions asynchronously. This method sends a callback to the server and raises the server CustomCallback event.

Use the args parameter to pass client-side information to the server CustomCallback event handler. Use the server event parameter’s Argument property to obtain this information on the server-side.

The onSuccess parameter allows you to specify a client-side function that the Gantt control executes after the round trip to the server is successfully completed.

The following example shows how to pass a clicked task’s key value to the CustomCallback event handler. The Gantt control executes the clientSideFunction function every time it successfully completes a round trip to the server with the PerformCallback method.

<script type="text/javascript">
    function onClickTask(s, e) {
        clientGantt.PerformCallback(e.key, clientSideFunction());
    }

    function clientSideFunction(s, e) {
        //...
    }
</script>

<dx:ASPxGantt ID="Gantt" runat="server" ClientInstanceName="clientGantt" OnCustomCallback="Gantt_CustomCallback" ...>
    <!--...-->
</dx:ASPxGantt>
protected void Gantt_CustomCallback(object sender, DevExpress.Web.ASPxGantt.GanttCustomCallbackEventArgs e){
    string key = e.Argument;
    //...
}
See Also