Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active January 7, 2021 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/32d337bab13f449466d9700278ec68f4 to your computer and use it in GitHub Desktop.
Save bjoerntx/32d337bab13f449466d9700278ec68f4 to your computer and use it in GitHub Desktop.
function mergeDocument() {
// save the document in the internal tx format
TXTextControl.saveDocument(TXTextControl.StreamType.InternalUnicodeFormat,
function (e) {
var serviceURL = "@Url.Action("Merge", "Home")";
// send document to controller
$.ajax({
type: "POST",
url: serviceURL,
data: {
document: e.data // the template
},
success: successFunc,
error: errorFunc
});
});
}
function successFunc(data, status) {
// load the resulting document back into the editor
TXTextControl.loadDocument(TXTextControl.StreamType.InternalUnicodeFormat, data);
}
function errorFunc() {
alert("Error");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment