How to clear a DatePicker

前端 未结 2 460
攒了一身酷
攒了一身酷 2021-01-19 02:34

I have a DatePicker for selecting birthday.

This is going to be used for some filtering, and after the filtering, I will like the value to be

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-19 02:46

    If you want to clear the TextField of the DatePicker, you can use :

    datepicker.getEditor().clear();
    

    If you want to clear the value and the textfield, use :

    datePicker.setValue(null);
    

提交回复
热议问题