Hi
Anyone had any luck adding a dojo date text box to a Web App Builder widget ?
I have a project coming up and i was just wondering if anyone had successfully used it.
Thanks
Jonathan
Jonathan,
I have done it many time. Are you have a problem with your code?
Hi Robert
I have created a date text box with the following;
new OracleDateTextBox({
value: this._getDate('today'),
name: "calTo",
style: { width: '140px' },
onChange: lang.hitch(this, function(v){ setTimeout(this.showServerValue('to'), 0)}),
constraints: { datePattern : 'dd/MM/yyyy' },
}, this.calTo).startup();
Html in widget;
From:<input data-dojo-attach-point="calFrom" />
I am struggling with the syntax to set the value in the calendar;
setDateByHours: function(e){
var today = new Date();
var todayReal = new Date();
console.log(e.target.id);
switch (e.target.id) {
case '24':
today.setDate(today.getDate() - 1);
break;
case '48':
today.setDate(today.getDate() - 2);
break;
case '4Days':
today.setDate(today.getDate() - 4);
break;
case '7Days':
today.setDate(today.getDate() - 7);//d.setMonth(d.getMonth() - 3);
break;
case 'month':
today.setMonth(today.getMonth() - 1);
break;
}
dijit.byId('calFrom').attr("value", today);
dijit.byId('calTo').attr("value", todayReal);
},
Any ideas what I am doing wrong ??
Thanks
Jonathan
Jonathan,
I have never heard of a OracleDateTextBox or worked with it. Is there a reason you do not just use the standard dijit/form/DateTextBox?
Hi
I managed to fix it in the end, by adding an id to the html in widget.html
The data we are accessing has time enabled, so I decided to use the OracleDateTextBox example off dojo`s website.
Thanks
Jonathan