When you are documenting the data in Electronic Lab Notebook (ELN) and Laboratory Information Management System (LIMS), it is often necessary to refer to another record for clarification. For instance, if you are mentioning an experiment in your report, you may wish to show which protocol was used. One way of doing this would be with the ForeignKey or ForeignKeyMultiple widgets developed by Labii Inc..
The widgets are developed using Materialize CSS Select component, so it is required that the necessary packages are installed before using them.
This page is available at https://labii.github.io/labii-widget-foreignkey/
ForeignKey is a widget to make lists of data available for selection based on an API URL. In the edit mode, it enbles you to choose a record from dropdown; in the read-only mode, ForeignKey presents a clickable link for whichever value has been chosen. This tool is usually found in cases where only one piece of information needs to be referred to.
- Click the field to display the dropdown
- Type any terms
- Click
Search
button to search - Click
Load more
button to load another page of data - Select an option
title
, The title of the form field to be displayedurl
, The API URL to query the optionsenum
andenumNames
, The dropdown values and options- Leave it emtpy (
[]
) to enable the widget to query the first page as default options
- Leave it emtpy (
widget
, Set the widget value asMaterialFormForeignKey
default
, The default value to be included
foreignkey: {
title: "MaterialFormForeignKey",
type: "string",
url: getAPI({
name: 'anno',
table: Tables["applications"],
level: 'organization',
sid: "ehkn0a40x1glqvAFKP",
serializer: 'name',
get: "page_size=5"
}),
enum: [],
enumNames: [],
widget: "MaterialFormForeignKey"
},
As with the ForeignKey widget, the ForeignKeyMultiple widget allows you to select multiple records. It can be used to handle one-to-many or many-to-many relationships.
The usage is identical to the ForeignKey widget.
The Configuration is identical to the ForeignKey widget.
foreignkeymulti: {
title: "MaterialFormForeignKeyMultiple",
type: "array",
url: getAPI({
name: 'anno',
table: Tables["applications"],
level: 'organization',
sid: "ehkn0a40x1glqvAFKP",
serializer: 'name',
get: "page_size=5"
}),
enum: [],
enumNames: [],
widget: "MaterialFormForeignKeyMultiple"
},
Labii (https://www.labii.com) facilitates research and development by providing a user-friendly, customizable Electronic Lab Notebook (ELN) and Laboratory Information Management System (LIMS) to document, manage, and interpret data. Labii ELN & LIMS can be configured for any type of data, and the functions can easily be enhanced and expanded by stand-alone applications. We address the unique needs of each of our customers and are the trusted provider of hundreds of biotech companies and academic labs.