Vizit Pro JavaScript API

In addition to configuring Vizit Pro using a Configuration Profile,  you might want to check out these helpful methods for interacting with Vizit Pro as well: 

6.0 Pro API: http://files.vizit.com/public/docs/pro/6.0/
5.3 Pro API: http://files.vizit.com/public/docs/pro/5.3/
5.2 Pro API: http://files.vizit.com/public/docs/pro/5.2/
5.1 Pro API: http://files.vizit.com/public/docs/pro/5.1/
5.0 Pro API: http://files.vizit.com/public/docs/pro/5.0/
4.1 Pro API: http://files.vizit.com/public/docs/pro/4.1/

The methods documented there can be helpful when developing custom buttons for the Vizit Pro toolbar using Configuration Profiles.

Examples

Each of these examples are deployed using a custom Configuration Profile which is explained in detail here: http://support.vizit.com/entries/20409332-Vizit-Pro-Configuration-Profiles

Close the Current Tab

This example loads Pro with just a single button in the toolbar that closes the currently active tab.

function ConfigureVizit() {
return {
Toolbars: [{
title: 'Actions',
items: [{
text: 'Close Active Tab',
handler: function() {
Vizit.API.Close();
}
}]
}]
};
}

Close All But the Currently Active Tab

This example will add a button that closes all but the currently active tab. I've included the Document Explorer in the UI so that you can open multiple documents before clicking the button.

function ConfigureVizit() {
return {
ExplorerGrid: {
enabled: true
},
Toolbars: [{
title: 'Actions',
items: [{
text: 'Close All But This',
handler: function() {
Vizit.API.ActiveDocument(function(activeDoc, activeTab) {
Vizit.API.EachDocument(function(doc, tab) {
if(activeTab != tab) Vizit.API.Close(tab);
});
});
}
}]
}]
};
}

Check Out On Open

This example attaches to the onLoad event and if the document is supported by Vizit Pro, it will be checked out. I've included the Document Explorer so you can see the "Checked Out" key appear next to the document after it's been opened to confirm that it was properly checked out.

function ConfigureVizit() {
return {
ExplorerGrid: { enabled: true },
Document: {
onLoad: function(args) }
if(args.IsSupported && args.IsDocumentTab) {
Vizit.API.CheckOut();
}
}
}
};
}
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk