Data type of Data Field of organizing DataSet.
Specify by DataFiled.dataType property.
TEXT | "text" | String. It is saved as String or undefined in data set. null is saved as undefined. |
NUMBER | "number" | Number. It is saved as Number or undefined in data set. In particular, NaN, null, empty string are saved as undefined. |
BOOLEAN | "boolean" | Boolean type. It can have the values of true, false, undefined. null, empty string are saved as undefined. |
DATETIME | "datetime" | It is saved as JavaScript Date object or undefined.
After importing DATETIME type value from DataSet, you should not change this value. It is because it will return original Date object created within DataSet. So, it should be handled as Read-only object. |
OBJECT | "object" | Save a random JSON object. ( ver 1.3.5 )
Data Set manages the change state in saved object unit. In other words, only if the object itself is changed, it will change internal state and fire related events. It does not check whether object property is changed or fire events. In addition, since it cannot display all properties of the object with unknown structure in the grid, you should set DataField.keyPath or keyCallback property. |
var fields = [{
fieldName: 'addr',
dataType: DataLudi.ValueType.TEXT
}, {
fieldName: 'distance',
dataType: 'number'
},
...
];
dataSource.setFields(fields);