module:app/models/Field

module:app/models/Field

new module:app/models/Field(fieldObj)

This will map selected properties into an observable or an observableArray, and the rest will be copied or ignored
Parameters:
Name Type Description
fieldObj Object The valid field settings object
Source:
See:
  • module:templates/index
Requires:
  • module:knockout
  • module:common
Example

Example usage for Field

//use it before adding the field to the array of fields
var field = new Field(field_settings);
//then add it to the observableArray that is responsible for showing the fields
//for example you have fields_array variable
var fields_array = ko.observableArray([]);
fields_array(field);

Requires

  • module:knockout
  • module:common

Members

childFields :Array

The child field(s) of this field
Type:
  • Array
Source:

key :Number

The field type
Type:
  • Number
Source:

name :String

The name of the field generated using common#createUuid
Type:
  • String
Source:
See:
  • common#createUuid

numbering :Number

If the module:js/models/Field#showNumbering is true, this will contain the numbering order of the field
Type:
  • Number
Source:
See:
  • module:js/models/Field#showNumbering

parent :String

The direct parent of this field, will hold it's parent name
Type:
  • String
Source:

repeatable :Boolean

A flag to mark the field as a repeatable, used on the report editing where the user can add multiple copies of the field
Type:
  • Boolean
Source:

showControls :Boolean

A flag used to determine if the field controls(edit, delete, drag) will be displayed
Type:
  • Boolean
Source:

showNumbering :Boolean

A flag for the numbering visibility
Type:
  • Boolean
Source:

(inner) casts :Object

The property to be casted to the specified type
Type:
  • Object
Source:

(inner) ignoredProperties :Array

The properties that will be ignored, or they're just here if the value needs only to be copied
Type:
  • Array
Source: