IO.setAsyncSaveXMLFunction

Use this function to configure Xopus to save your document using in an asynchronous fashion. It has but one difference with IO.setSaveXMLFunction, namely the callback argument. Until the callback function is executed, Xopus will show busy notification in the user interface, and the saving button will be disabled.

Main advantage over synchronous saving is that the user interface will remain responsive. The saving will be done in the background, and even during saving the author can continue editing.

This example shows how to implement a asynchronous save function using jQuery.

function asyncSave(uri, doc, callback)
{
  jQuery.ajax({
    url:         uri,
    type:        "POST",
    contentType: "application/xml",
    data:        doc,
    complete:    callback
  });
}

IO.setAsyncSaveXMLFunction(asyncSave);

The callback function has one argument that indicates the success, which can either be true or false.


IO.setAsyncSaveXMLFunction( fn : Function)

Arguments

fn
Function. User defined save handler.