Select to view content in your preferred language

How do I add a dijit/form/DateTextBox to a widget?

2090
3
Jump to solution
08-01-2017 08:26 AM
DirkVandervoort
Frequent Contributor

From dijit/form/DateTextBox — The Dojo Toolkit - Reference Guide 

Uses claro css.

In widget.html:

<div>
 <label for="date1">Drop down Date box:</label>
 <input type="text" name="date1" id="date1"
 data-dojo-type="dijit/form/DateTextBox"
 required="true" />
</div>‍‍‍‍‍‍

And in widget.js I've defined dijit/form/DateTextBox.

Yet my results are less than pleasing

Any direction and/or clue would be appreciated. TIA 

1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Dirk,

   In your widget.js do you have _WidgetsInTemplateMixin as part of your declare array?

View solution in original post

3 Replies
RobertScheitlin__GISP
MVP Emeritus

Dirk,

   In your widget.js do you have _WidgetsInTemplateMixin as part of your declare array?

DirkVandervoort
Frequent Contributor

DOH! Got it working. Needed to define DateTimeBox:

define(['dojo/_base/declare',
    'jimu/BaseWidget',
    'dijit/form/DateTextBox',
    'dijit/_WidgetsInTemplateMixin',
    'esri/graphic' ],
  function(declare,
      BaseWidget,
      DateTextBox,
      _WidgetsInTemplateMixin,
      Graphic) {
    //To create a widget, you need to derive from BaseWidget.
    return declare([BaseWidget, _WidgetsInTemplateMixin], {
      // Custom widget code goes here
0 Kudos
by Anonymous User
Not applicable

Hi Dirk,

could you show me the whole code for your widget?

so the html and js files?

I still can't get my datetimebox working...