0

I need some help with my mvc application.

I am using the following code to create a Kendo TimePicker.

@(Html.Kendo().TimePicker().Name("FirstShiftFrom" + prop.PropertyName.Substring(0, 3))
                           .HtmlAttributes(new { @class = "workHoursTimePicker " + prop.PropertyName ,@disabled = "disabled" ,style="width:85px"})

How can I enable this control?

I have tried this in js :

document.get.Element.By.Id("id").disabled = false;

but it is not working!

ekad
  • 13,718
  • 26
  • 42
  • 44
saleem
  • 115
  • 1
  • 2
  • 12
  • FYI: please read the [doc](http://docs.telerik.com/kendo-ui/api/javascript/ui/datetimepicker#methods-enable) sir.. – Dion Dirza Mar 23 '15 at 07:47

1 Answers1

3

Instead of using HTML disabled attribute to disable the Kendo Time picker use Enable method of Kendo Time picker widget.

e.g.

@(Html.Kendo().TimePicker().Name("FirstShiftFrom" + prop.PropertyName.Substring(0, 3))
                       .HtmlAttributes(new { @class = "workHoursTimePicker " + prop.PropertyName, style = "width:85px" })
                       .Enable(false))

This will disable the Time picker and to enable it use this in javascript:

$("#TimePickerId").data("kendoTimePicker").enable(true);

Hope this helps!

Satya Ranjan Sahoo
  • 1,056
  • 7
  • 24