Difference between revisions of "Editable Data Grid"

From Mea Wiki
Jump to navigation Jump to search
Line 38: Line 38:
 
* '''dropdown''': list of fixed items that are defined in '''dropdownoptions''' property.
 
* '''dropdown''': list of fixed items that are defined in '''dropdownoptions''' property.
 
* '''metricsdate''': Date selector that can store Metrics date type of series
 
* '''metricsdate''': Date selector that can store Metrics date type of series
* '''date''': Date selector that can store values using XML date format (e.g. 2017-10-05T16:26:42)
+
* '''date''': Date selector that can store values using XML date format (e.g. 2018-10-05T16:26:42)
* '''checkbox''': checkbox
+
* '''checkbox''': Checkbox for storing two options. The strings to store are defined in '''trueValue''' and '''falseValue'''.
 
|-
 
|-
 
||dropdownoptions
 
||dropdownoptions
||Options for the dropdown menu (object array with properties "label" [user visible text] and "value" [text to store to MEA]) (only used when "dropdown" is checkbox)
+
||Options for the dropdown menu (object array with properties '''label''' [user visible text] and '''value''' [text to store to MEA]). Only used when '''dropdown''' is checkbox.
 
|-
 
|-
 
||trueValue
 
||trueValue
||attribute value corresponding to checkbox checked state (only used when "type" is checkbox)
+
||attribute value corresponding to checkbox checked state (only used when '''type''' is checkbox)
 
|-
 
|-
 
||falseValue
 
||falseValue
||attribute value corresponding to checkbox unchecked state (only used when "type" is checkbox)
+
||attribute value corresponding to checkbox unchecked state (only used when '''type''' is checkbox)
 
|-
 
|-
 
||allowEditing
 
||allowEditing
Line 55: Line 55:
 
||format
 
||format
 
||
 
||
 +
|-
 +
||validationRules
 +
||
 +
* '''required''': Requires an element.
 +
* '''minlength''': Requires the element to be of given minimum length.
 +
* '''maxlength''': Requires the element to be of given maximum length.
 +
* '''range''': Requires the element to be in given value range.
 +
* '''min''': The element requires a given minimum.
 +
* '''max''': The element requires a given maximum.
 +
* '''range''': Requires the element to be in a given value range.
 +
* '''email''': The element requires a valid email.
 +
* '''url''': The element requires a valid URL
 +
* '''digits''': The element requires digits only.
 +
* '''creditcard''': Requires the element to be a credit card number.
 
|-
 
|-
 
|}
 
|}

Revision as of 20:19, 14 February 2018


Property Description
selectedRowVariable Context variable where currently selected row's object id of stored.
query Query parameter for the QPR Suite Web Service query to get the rows to the data grid.
sortby Sorting parameter for the QPR Suite Web Service query to get the rows to the data grid.
queryoptions Options parameter for the QPR Suite Web Service query to get the rows to the data grid.
columns Array of objects where each represent a column in the editable data grid.
Property Description
attribute QPR Suite Web Service attribute name.
attributeParameters Parameters for the attribute.
headerText Column header text that is visible to users.
type
  • textbox: textbox for storing string values.
  • numericbox: textbox for numeric values.
  • dropdown: list of fixed items that are defined in dropdownoptions property.
  • metricsdate: Date selector that can store Metrics date type of series
  • date: Date selector that can store values using XML date format (e.g. 2018-10-05T16:26:42)
  • checkbox: Checkbox for storing two options. The strings to store are defined in trueValue and falseValue.
dropdownoptions Options for the dropdown menu (object array with properties label [user visible text] and value [text to store to MEA]). Only used when dropdown is checkbox.
trueValue attribute value corresponding to checkbox checked state (only used when type is checkbox)
falseValue attribute value corresponding to checkbox unchecked state (only used when type is checkbox)
allowEditing
format
validationRules
  • required: Requires an element.
  • minlength: Requires the element to be of given minimum length.
  • maxlength: Requires the element to be of given maximum length.
  • range: Requires the element to be in given value range.
  • min: The element requires a given minimum.
  • max: The element requires a given maximum.
  • range: Requires the element to be in a given value range.
  • email: The element requires a valid email.
  • url: The element requires a valid URL
  • digits: The element requires digits only.
  • creditcard: Requires the element to be a credit card number.

Available validation: http://jqueryvalidation.org/documentation/#link-list-of-built-in-validation-methods


{
  "editSettings": {
    "allowAdding": true,
    "allowDeleting": true,
    "allowEditing": true,
    "allowEditing": "normal"
  },
  "toolbarSettings": {
    "showToolbar": true,
    "toolbarItems": ["add", "edit", "delete", "update", "cancel"]
  }                             
}
{
  "columns": [
    { allowEditing: false },
  ]                             
}

Batch editing is not supported by the editable data grid (editSettings: { allowEditing: "batch" })