Clearing date from date picker

263
4
02-02-2020 02:50 PM
MuhammadYasir
New Contributor III

Hi there,

I am using the date selector in my operation dashboard. Within date selector, I am using date picker with input type "Range". The problem I am facing is that I couldn't see any way to clear the dates from date picker when I want to go back to normal view. I have to refresh the page every time. Is there any way to clear the selected dates from the date picker?

Tags (2)
0 Kudos
4 Replies
ThanHtetAung_EsriAu
Esri Regular Contributor

Hi Muhammad Yasir‌,

I used to be able to clear the date input by using datetextbox

In widget.html

<input data-dojo-type="dijit/form/DateTextBox" data-dojo-attach-point="sourceDate" />

In widget.js

this.sourceDate.setValue("");

One thing to take note is you need to import widgettemplatemixin and better to call this.inherited(arguments) method at post create.

The best for that kind of question is by sharing your code.

0 Kudos
MuhammadYasir
New Contributor III

Should I suppose to change the json file??? Sorry I didnt get it.

0 Kudos
MuhammadYasir
New Contributor III

I never looked at widget.html and js file. Could you please guide me where are these files located and how can we make changes???

0 Kudos
VivekMalleshappa
Esri Contributor

Hi! Does selecting the whole date field and hitting delete on your keyboard work?

0 Kudos