I have a JS overlay layer which sets up data entry controls on my web app as dojo widgets. I grab inputs like <input type="text" class="date" /> and turn them into DateTextBox
widgets.
Here is my basic code:
var df = dateformat;
df.replace('mm', 'MM');
var val = input.value;
if (val == undefined){
val = '';
}
return new datebox({
"label": input.title,
"value": val,
"name": input.name,
"id": input.id,
"constraints": { "datePattern": df }
});
My problem is that all DateTextBox's end up set with '1970-00-01' as the initial date if no value is provided. I would like them to be set to null or undef if no value is provided but this doesn't seem possible until after startup.
Is there a way to set this before I call widget.startup()
?