eLabSDK.AdminSettingsManagement Class
Class that allows to add custom settings in the /admin/systemSettings/ page
Constructor
eLabSDK.AdminSettingsManagement
-
object
Parameters:
-
object
Object-
onAfterPageLoad
Function- Include your code here due to the aSync nature of this class
-
Item Index
Methods
addSettings
-
settings
Add custom settings to the page
Parameters:
-
settings
Struct
Example:
var adminSettingMgmt = new eLabSDK.Page.AdminSettingsManagement({ onAfterPageLoad: function (page) { if (page) { var settings = { header : "This is a title", id : "thisismyid", rows : [ { fields : [ {id: "custom:newCombo", type: "combo", description : "This [x] is a combo", values : [{key : "One", value : 1}, {key : "Two", value : 2}]}, {id: "custom:newGroupcheckbox", type: "groupcheckbox", description : "This is a groupcheckbox : [x]", values : [{key : "One", value : 1}, {key : "Two", value : 2}]}, ], description : "This is a description", descriptionSize : 0.6 }, { fields : [ {id: "custom:newCheckbox", type: "checkbox", description : "This is a checkbox [x]", value : "test"}, {id: "custom:newInput", type: "input", description : "Is an input "}, {id: "custom:newDate", type: "date", description : "Is a date "}, {id: "custom:newNumber", type: "number", description : "Is a numeric "}, {id: "custom:newRadio", type: "radio", description : "This is a radio : [x]", values : [{key : "One", value : 1}, {key : "Two", value : 2}]}, ], description : "This is another description", descriptionSize : 0.6 } ] } page.addSettings(settings); } } });
getCheckBox
-
field
Return a checkbox containing information related to the specified field
Parameters:
-
field
Obj
Returns:
setting
getComboBox
-
field
Return a combobox containing information related to the specified field
Parameters:
-
field
Obj
Returns:
setting
getDateInput
-
field
Return an date field containing information related to the specified field
Parameters:
-
field
Obj
Returns:
setting
getGroupCheckBox
-
field
Return a group checkbox containing information related to the specified field
Parameters:
-
field
Obj
Returns:
setting
getNumberInput
-
field
Return an number field containing information related to the specified field
Parameters:
-
field
Obj
Returns:
setting
getRadioBox
-
field
Return a radio box containing information related to the specified field
Parameters:
-
field
Obj
Returns:
setting
getRadioBox
-
field
Return an input field containing information related to the specified field
Parameters:
-
field
Obj
Returns:
setting
getSettingsFromDb
()
Get the value of the custom settings on the page from the db
getSettingValue
-
setting
Get the value from the setting on the page, depending its type
Parameters:
-
setting
HTMLElement
Returns:
value
registerGroupEditItem
()
Renders an additional action item in the menu for groups
Example:
var p = new eLabSDK.Page.AdminAccountManagement();
p.registerGroupEditItem({
key: 'my_custom_key',
label: 'My Custom Action',
action: function(groupID){
console.log('I can now do some action for the group ' + groupID);
}
});
saveSettingsToDb
()
Save the custom settings to the database
setSettingValue
-
settingKey
-
settingValue
Set the value of the setting on the page from the db, depending its type
Parameters:
-
settingKey
String: current setting key
-
settingValue
String: current setting value