PDA

View Full Version : [CLOSED] how to select current date to ext:DateField ?



hdsoso
May 28, 2013, 7:02 AM
when page is loaded , ext:DateField defaultly select the current date.


<ext:DateField ID="DateField1" Format="yyyy-MM-dd" runat="server" InputWidth="90" LabelWidth="35"></ext:DateField>

Akpenob
May 28, 2013, 7:55 AM
when page is loaded , ext:DateField defaultly select the current date.


<ext:DateField ID="DateField1" Format="yyyy-MM-dd" runat="server" InputWidth="90" LabelWidth="35"></ext:DateField>


Hi Hdsoso

What do you mean by "Select" the current date..

normaly you can set the date by setting the SelectedDate value via the datefield property...

if this is created on the backend, then do this.


DateField df = new DateField();
df.SelectedDate = DateTime.Now; // this sets the current date on the Datefield component.


like wise if its via html then its like this..



<ext:DateField runat="sever" ID="myDatefield" SelectedDate ="2013-05-05"></ext:DateField>


Regards Akpenob