API Docs for: 1.0.0
Show:

eLabSDK.AdminSettingsManagement Class

Extends eLabSDK.Page
Module: eLabSDK

Class that allows to add custom settings in the /admin/systemSettings/ page

Constructor

eLabSDK.AdminSettingsManagement

(
  • object
)
async

Parameters:

  • object Object
    • onAfterPageLoad Function
      • Include your code here due to the aSync nature of this class

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
)
String

Return a checkbox containing information related to the specified field

Parameters:

  • field Obj

Returns:

String:

setting

getComboBox

(
  • field
)
String

Return a combobox containing information related to the specified field

Parameters:

  • field Obj

Returns:

String:

setting

getDateInput

(
  • field
)
String

Return an date field containing information related to the specified field

Parameters:

  • field Obj

Returns:

String:

setting

getGroupCheckBox

(
  • field
)
String

Return a group checkbox containing information related to the specified field

Parameters:

  • field Obj

Returns:

String:

setting

getNumberInput

(
  • field
)
String

Return an number field containing information related to the specified field

Parameters:

  • field Obj

Returns:

String:

setting

getRadioBox

(
  • field
)
String

Return a radio box containing information related to the specified field

Parameters:

  • field Obj

Returns:

String:

setting

getRadioBox

(
  • field
)
String

Return an input field containing information related to the specified field

Parameters:

  • field Obj

Returns:

String:

setting

getSettingsFromDb

()

Get the value of the custom settings on the page from the db

getSettingValue

(
  • setting
)
String

Get the value from the setting on the page, depending its type

Parameters:

  • setting HTMLElement

Returns:

String:

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