eLabSDK2.Inventory.Sample.SampleForm

Hierarchy

  • unknown

    SampleForm

Methods

filterSampleTypes

Static filterSampleTypes(filter): void

Filter sampletypes when adding a new sample

Parameters

NameTypeDescription
filterFunctionFunction receiving sampletype as argument that should return false in case the sampletype should be filtered out. @example: eLabSDK2.Inventory.Sample.SampleForm.filterSampleTypes((st) => !st.name.includes('Dont list me'))

Returns

void


getSampleFieldFromSampleForm

Static getSampleFieldFromSampleForm(fieldName): HTMLInputElement

Retrieve a sample field from the field name

Parameters

NameType
fieldNamestring

Returns

HTMLInputElement

field : field if found


onAddNewSampleFormLoaded

Static onAddNewSampleFormLoaded(callback, id): void

Triggers the given callback function when new sample form is loaded
is loaded in the add sample form page

Parameters

NameTypeDescription
callback(event: CustomEvent<SampleFormInterface>) => voidCallback function to call when the sample form is ready
idstring-

Returns

void


onAfterAddSampleFormLoad

Static onAfterAddSampleFormLoad(callback, id): void

Triggers the callback after the dom has been rendered

Example

// in side-load format
var onAfterSampleFormLoadExample = {};

(function (context) {
  context.init = function (data) {
    eLabSDK2.Inventory.Sample.SampleForm.onAfterAddSampleFormLoad(() => {
      console.log("After sample form load");
    }, "my-unique-id");
  };
  // required while sideloading, remove upon release
  context.init();
})(onAfterSampleFormLoadExample);

Parameters

NameTypeDescription
callbackFunction:Function callback function to be executed
idstring:string unique identifier of callback

Returns

void


onAfterEditSampleFormLoad

Static onAfterEditSampleFormLoad(callback, id): void

Triggers the callback after the dom has been rendered

Example

// in side-load format
var onAfterEditSampleFormLoad = {};

(function (context) {
  context.init = function (data) {
    eLabSDK2.Inventory.Sample.SampleForm.onAfterEditSampleFormLoad(() => {
      console.log("After sample edit form load");
    }, "my-unique-id");
  };
  // required while sideloading, remove upon release
  context.init();
})(onAfterEditSampleFormLoad);

Parameters

NameTypeDescription
callbackFunction:Function callback function to be executed
idstring:string unique identifier of callback

Returns

void


onBeforeAddSampleFormLoad

Static onBeforeAddSampleFormLoad(callback, id): void

Triggers the callback prior to loading the data / DOM

Example

// in side-load format
var onBeforeSampleFormLoadExample = {};

(function (context) {
  context.init = function (data) {
    eLabSDK2.Inventory.Sample.SampleForm.onBeforeAddSampleFormLoad(() => {
      console.log("Before sample form load");
    }, "my-unique-id");
  };
  // required while sideloading, remove upon release
  context.init();
})(onBeforeSampleFormLoadExample);

Parameters

NameTypeDescription
callbackFunction:Function callback function to be executed
idstring:string unique identifier of callback

Returns

void


onBeforeEditSampleFormLoad

Static onBeforeEditSampleFormLoad(callback, id): void

Triggers the callback prior to loading the data / DOM

Example

// in side-load format
var onBeforeEditSampleFormLoad = {};

(function (context) {
  context.init = function (data) {
    eLabSDK2.Inventory.Sample.SampleForm.onBeforeEditSampleFormLoad(() => {
      console.log("Before sample edit form load");
    }, "my-unique-id");
  };
  // required while sideloading, remove upon release
  context.init();
})(onBeforeEditSampleFormLoad);

Parameters

NameTypeDescription
callbackFunction:Function callback function to be executed
idstring:string unique identifier of callback

Returns

void


registerAction

Static registerAction(action): void

Register a custom action for the sample form

Parameters

NameType
actionAction

Returns

void


setSampleFormData

Static setSampleFormData(data): void

Set Sample Form Data

Parameters

NameType
dataSampleFormInputData[]

Returns

void


© 2023 eLabNext