eLabSDK.CustomSectionType Class
Class that allows the creation of a custom section type. The class registers the custom section type in the sdk
Constructor
eLabSDK.CustomSectionType
(
async
-
category
-
type
-
label
-
getContent
Parameters:
-
category
String- category for the custom type [data / text / inventory / files / ... ]
-
type
Stringcustom type classifier
-
label
Stringdisplay name for the custom type
-
getContent
Function- return html string to display in the section
Example:
Example usage in plugin: var my_root_var = {}; (function (context) { context = new eLabSDK.Experiment.CustomSectionType({ category: 'mycategory [data / text / inventory / files / ... ]', type: 'MyCustomSectionType', // the classifier of the custom type label: 'My label', // display name getContent: (data) => ('
return html to display
')
});
})(my_root_var);
Item Index
Properties
Methods
addSection
(
-
configObject
-
onCreated
Adds a section to this experiment
Parameters:
-
configObject
Obj-
header
String- Section Header Text
-
type
eLabSDK.Experiment.Section.SECTIONTYPE- Section Type
-
-
onCreated
Function
getExperimentID
()
Int
Returns:
Int:
experimentID
getMeta
()
Returns:
metadata of section
getSection
(
eLabSDK.Experiment.Section
-
sectionID
Gets the section object by ID
Parameters:
-
sectionID
Type
Returns:
eLabSDK.Experiment.Section:
section or null of it doest not exist
getStudyID
()
Int
Returns:
Int:
studyID
Properties
object.type
eLabSDK.Experiment.Section.SECTIONTYPE
sections
Array
Array of eLabSDK.Experiment.Section
Sections of experiment
Events
onCreated
Use
this
to access class
Example:
var ev = experimentObject.onCreated(function () {
alert('Experiment created');
});
onLoaded
Use
this
to access class
Example:
var ev = experimentObject.onLoaded(function () {
alert('Experiment onLoaded');
});