How to highlight today date in DateTextBox in dojo

Is there a way to highlight (show selected) the current date in a dojo DateTextBox when the text field is empty? I do not want to show the date in the text box (it should remain empty), but just to show today's date as selected.

I tried using the 'dropDownDefaultValue' attribute provided by dojo for this, but it does not work (the current value does not appear as selected or highlighted).

I am using dojo version 1.7.1.

Any suggestions in this regard would be helpful.

+4
source share
1 answer

If you look at the html that is used for the DateTextBox , you will see that td for the current date looks like this:

 <td class="dijitCalendarEnabledDate dijitCalendarCurrentDate dijitCalendarCurrentMonth dijitCalendarDateTemplate" role="gridcell" data-dojo-attach-point="dateCells" aria-selected="false" tabindex="0"> <span class="dijitCalendarDateLabel" data-dojo-attach-point="dateLabels">30</span> </td> 

If you want to style the current date so that it looks different, you should update the css selector, for example

 .dijitCalendarDateTemplate.dijitCalendarCurrentDate{ /*your styling */ background-color: green; } 
+7
source

All Articles