Options
All
  • Public
  • Public/Protected
  • All
Menu

A simple class for creating HTML forms.

Hierarchy

  • mxForm

Index

Constructors

constructor

  • new mxForm(className: string): mxForm
  • Creates a HTML table using the specified classname.

    Parameters

    • className: string

    Returns mxForm

Properties

body

body: boolean

Holds the DOM node that represents the tbody (table body). New rows can be added to this object using DOM API.

table

table: HTMLTableElement

Holds the DOM node that represents the table.

Methods

addButtons

  • addButtons(okFunct: Function, cancelFunct: Function): void
  • Helper method to add an OK and Cancel button using the respective functions.

    Parameters

    • okFunct: Function
    • cancelFunct: Function

    Returns void

addCheckbox

  • addCheckbox(name: string, value: boolean): HTMLInputElement
  • Adds a checkbox for the given name and value and returns the textfield.

    Parameters

    • name: string
    • value: boolean

    Returns HTMLInputElement

addCombo

  • addCombo(name: string, isMultiSelect: boolean, size?: number): HTMLSelectElement
  • Adds a combo for the given name and returns the combo.

    Parameters

    • name: string
    • isMultiSelect: boolean
    • Optional size: number

    Returns HTMLSelectElement

addField

addOption

  • addOption(combo: HTMLElement, label: string, value: any, isSelected?: boolean): void
  • Adds an option for the given label to the specified combo.

    Parameters

    • combo: HTMLElement
    • label: string
    • value: any
    • Optional isSelected: boolean

    Returns void

addText

  • addText(name: string, value: any, type: string): HTMLInputElement
  • Adds an input for the given name, type and value and returns it.

    Parameters

    • name: string
    • value: any
    • type: string

    Returns HTMLInputElement

addTextarea

  • addTextarea(name: string, value: string, rows: number): HTMLTextAreaElement
  • Adds a textarea for the given name and value and returns the textarea.

    Parameters

    • name: string
    • value: string
    • rows: number

    Returns HTMLTextAreaElement

getTable

  • getTable(): HTMLTableElement
  • Returns the table that contains this form.

    Returns HTMLTableElement

Generated using TypeDoc