This is a migrated thread and some comments may be shown as answers.

DatePicker Loses Its Style After Adding Events

1 Answer 68 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Umut
Top achievements
Rank 1
Umut asked on 13 Apr 2015, 06:05 PM

Hello, 

I have datepicker in my view as below, But after adding event as http://demos.telerik.com/aspnet-mvc/datepicker/events, it lost its style and looks like Jquery UI datepicker. 

When i  looked at the source code, without using events, the input type is string and output is like below:

<span class="k-picker-wrap k-state-default"><input data-val="true" data-val-date="The field Hakediş T. must be a date." data-val-required="The Hakediş T. field is required." id="CmsProgressPaymentDate" name="CmsProgressPaymentDate" style="width: 100%;" type="text" value="13.04.2015" data-role="datepicker" class="k-input k-valid" role="combobox" aria-expanded="false" aria-owns="CmsProgressPaymentDate_dateview" aria-disabled="false" aria-readonly="false"><span unselectable="on" class="k-select" role="button" aria-controls="CmsProgressPaymentDate_dateview"><span unselectable="on" class="k-icon k-i-calendar">select</span></span></span>

But when i added the onchange or another events, the input type becomes to date and the output as below, 

<input data-val="true" data-val-date="The field Hakediş T. must be a date." data-val-required="The Hakediş T. field is required." id="CmsProgressPaymentDate" name="CmsProgressPaymentDate" style="width:100%" type="date" value="13.04.2015">

 

@(Html.Kendo().DatePickerFor(p=>p.CmsProgressPaymentDate)
            .Name("CmsProgressPaymentDate")
            .Value(System.DateTime.Now)
            .HtmlAttributes(new { style = "width:100%" })
}

1 Answer, 1 is accepted

Sort by
0
Umut
Top achievements
Rank 1
answered on 13 Apr 2015, 06:51 PM

I am sorry, my mistake. 

 My JS function was faulty.

Tags
Date/Time Pickers
Asked by
Umut
Top achievements
Rank 1
Answers by
Umut
Top achievements
Rank 1
Share this question
or