eLabSDK2.Inventory.Sample.SampleForm
Hierarchy
- 
unknown↳ SampleForm
Methods
filterSampleTypes
Static filterSampleTypes(filter): void
Filter sampletypes when adding a new sample
Parameters
| Name | Type | Description | 
|---|---|---|
| filter | Function | Function 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
| Name | Type | 
|---|---|
| fieldName | string | 
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
| Name | Type | Description | 
|---|---|---|
| callback | ( event:CustomEvent<SampleFormInterface>) =>void | Callback function to call when the sample form is ready | 
| id | string | - | 
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
| Name | Type | Description | 
|---|---|---|
| callback | Function | :Function callback function to be executed | 
| id | string | :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
| Name | Type | Description | 
|---|---|---|
| callback | Function | :Function callback function to be executed | 
| id | string | :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
| Name | Type | Description | 
|---|---|---|
| callback | Function | :Function callback function to be executed | 
| id | string | :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
| Name | Type | Description | 
|---|---|---|
| callback | Function | :Function callback function to be executed | 
| id | string | :string unique identifier of callback | 
Returns
void
registerAction
Static registerAction(action): void
Register a custom action for the sample form
Parameters
| Name | Type | 
|---|---|
| action | Action | 
Returns
void
setSampleFormData
Static setSampleFormData(data): void
Set Sample Form Data
Parameters
| Name | Type | 
|---|---|
| data | SampleFormInputData[] | 
Returns
void
© 2023 eLabNext
Updated about 2 months ago