ELN/LES APIs |
Content |
||||||||
|
JavaScript API for ELN/LES Worksheets |
|
|
The JavaScript methods described below are not exposed in a *.js file. They are dynamically generated and mapped onto functionality provided by Google Web Tools.
Worksheet Manager Context |
The following JavaScript API methods are available within the context of the Worksheet Manager. As such, they can be used to perform operations specific to Worksheet Manager content (such as in buttons defined by Operations of Type "Custom" and Control editor JavaScript files).
These method are called on the sapphire.worksheet object.
Method | Description | ||||||||||||||||||||||
getConfigProperty ( propertyid, callback ) | Returns a configuration property of the current Control
via a callback function. Only simple properties are supported, i.e., PropertyList
or Collection cannot be returned with this method.
|
||||||||||||||||||||||
setConfigProperty ( propertyid, propertyvalue, refresh ) | Sets a configuration property of the current Control.
|
||||||||||||||||||||||
getConfigProperties ( callback ) | Returns all configuration properties of the current Control
via a callback function.
|
||||||||||||||||||||||
sapphire.worksheet.setConfigProperties ( jsonprops, merge, refresh ) | Sets all configuration properties for the current Control.
|
||||||||||||||||||||||
getCurrentType () | Returns the currently selected type (W=Worksheet, S=Section, I=Control). | ||||||||||||||||||||||
getCurrentId () | Returns the currently selected id. Depending on the type, this will be a worksheetid, sectionid or worksheetitemid. | ||||||||||||||||||||||
getCurrentVersion () | Returns the currently selected version. Depending on the type, this will be a worksheetversionid, sectionversionid or worksheetitemversionid. | ||||||||||||||||||||||
getWorksheetManagerWidth () | Returns the Worksheet Manager width in px. | ||||||||||||||||||||||
getWorksheetManagerHeight () | Returns the Worksheet Manager height in px. | ||||||||||||||||||||||
getWorksheetPanelWidth () | Returns the Worksheet Panel width (the middle Panel containing the Worksheet, excluding the ToC and details) in px. | ||||||||||||||||||||||
getWorksheetPanelHeight () | Returns the Worksheet Panel height (the middle Panel containing the Worksheet, excluding the ToC and details) in px. | ||||||||||||||||||||||
addReference ( refworksheetid, refworksheetversionid, refid, refversion, reftype, reffunction, refresh ) | Adds a reference to the current Control (these are shown
in the Show References dialog),
|
||||||||||||||||||||||
selectWorksheetItem ( worksheetid, worksheetversionid, callback ) | Allows a user to select a section or control from a worksheet
|
||||||||||||||||||||||
scrollToTop ( setfocus ) | Scrolls to the top of the Worksheet.
|
||||||||||||||||||||||
scrollToBottom ( setfocus ) | Scrolls to the bottom of the Worksheet.
|
||||||||||||||||||||||
setCurrentWorksheetItem ( worksheetitemid, worksheetitemversionid ) | Sets/selects the current Worksheet item (title, Section
or Control).
|
||||||||||||||||||||||
refresh () | Refreshes the current Control. | ||||||||||||||||||||||
refreshSection () | Refreshes the current Section, i.e., all Controls in the current Section. | ||||||||||||||||||||||
refreshWorksheet () | Refreshes/reloads the Worksheet. |
Global Context |
The following JavaScript API methods are available globally. They are currently used from the various control, worksheet and workbook pages.
These method are called on the sapphire.worksheet object.
Method | Description | ||||||||||
addWorksheet ( workbookid, workbookversionid, createCallback ) | Displays the Add Worksheet dialog to allow a new Worksheet
to be created.
|
||||||||||
copyWorksheet ( worksheetid, worksheetversionid, copyCallback ) | Displays the Copy Worksheet dialog to allow an existing
worksheet to be copied.
|
||||||||||
addTemplate ( templateprivacyflag, createCallback ) | Displays the Add Worksheet Template dialog to create a
new Worksheet Template.
|
||||||||||
addControlTemplate ( templateprivacyflag, createCallback ) | Displays the Add Control Template dialog to create a new
Control Template.
|
||||||||||
copyTemplate ( worksheetid, worksheetversionid, worksheetname, templateprivacyflag, copyCallback ) | Displays the Copy Worksheet Template dialog to copy an
existing Worksheet Template.
|
||||||||||
copyControlTemplate ( worksheetid, worksheetversionid, worksheetname, templateprivacyflag, copyCallback ) | Displays the Copy Control Template dialog to copy an existing
Control Template.
|
||||||||||
saveAsGlobal ( worksheetid, worksheetversionid, worksheetname, templatetype ) | Displays the Save As Global dialog to save an existing
Worksheet or Control Template as a Global Template.
|