Scandit.Ui.Modal

Methods

(static) show(options: object)

Shows modal

Parameters:
Name Type Description
options object
Properties
Name Type Attributes Default Description
title string

The title of the modal

text string

The text of the modal

buttons object[] <optional>
[{label: "YES", callback: null}, {label: "NO", callback: null}]

Array of buttons which will be displayed on the modal

  • The callback is passed an object with the inputs of the modal and their values, e.g. {inputs: {input: "value"}}
inputs object[] <optional>

Array of inputs definition.

  • Object structure: {name: string, placeholder: string, required: boolean, type: string}.
  • Possible types: text (default), number, email.
Examples
  • JavaScript
  • ES6
Scandit.Ui.Modal.show({
  title: 'Title',
  text: 'This is the text of the modal',
  buttons: [
    {
      label: 'OK',
      callback: function(inputFieldValue) { console.log(inputFieldValue); }
    }
  ],
  inputs: [
    {
      name: 'input',
      placeholder: 'placeholder',
      required: true,
      type: 'string'
    }
  ]
});
Scandit.Ui.Modal.show({
  title: 'Title',
  text: 'This is the text of the modal',
  buttons: [
    {
      label: 'OK',
      callback: inputFieldValue => { console.log(inputFieldValue); }
    }
  ],
  inputs: [
    {
      name: 'input',
      placeholder: 'placeholder',
      required: true,
      type: 'string'
    }
  ]
});