I have added a NumericTextBox to event editor so users can enter a Distance (in kilometers). My code is like this:
let inputEle2: HTMLInputElement = createElement('input', {
className: 'e-field', attrs: {name: 'km'}
}) as HTMLInputElement;
row.appendChild(container);
let distanceTextBox: NumericTextBox = new NumericTextBox({
value: 88,
format: 'n0',
floatLabelType: 'Auto',
placeholder: 'Kilometers'
//enableRtl: true
});
distanceTextBox.appendTo(inputEle2);
inputEle2.setAttribute('name', 'km');
I have tried playing around with different settings, like format: 'n0' but the value gets saved as a string nevertheless and i cannot do any calculations with them.
Any help would be appreciated.
ScheduleData in the MongoDB:
{
"_id": {
"$oid": "5e8a43220e1de11fe051e670"
},
"km": "92", <- this value is in quotation marks, i need it to be a number
"isFormal": false,
"Subject": "ewfwefewf",
"Location": "ewfwefewf",
"StartTime": {
"$date": "2020-04-11T16:30:00.000Z"
},
"EndTime": {
"$date": "2020-04-11T17:00:00.000Z"
},
"IsAllDay": false,
"StartTimezone": null,
"EndTimezone": null,
"Description": "wefwef",
"RecurrenceRule": null,
"Id": 7,
"CreatedBy": "Bob"
}