Hi to everyone.
I have an MVC view with a Kendo DatePicker
@(Html.Kendo().DatePicker()
.Name("myDataPicker")
.Value(DateTime.Now.Date)
.Format("dd/MM/yyyy")
.HtmlAttributes(new {style = "width: 150px;" })
)
I need to change the date of my element from javascript, and I'm doing it in this way
$("#myDataPicker").kendoDatePicker({
value: new Date(),
format: "dd/MM/yyyy", ( I have to do this because it doesn't remember the given format in the helper )
});
It works but this function changes some style in the element, in particular in the first span
k-input is added causing a padding issue and style has now a width:100%, not 150px as I set in the helper and I have when the page is just opened
so before
<span class="k-widget k-datepicker k-header" style="width: 150px;">
after
<span class="k-widget k-datepicker k-header k-input" style="width: 100%;">
I have to use an ugly workaround changing the class and style from jquery but I was wondering if there is a better solution
any help is appreciated
thank's
Mauro
I have an MVC view with a Kendo DatePicker
@(Html.Kendo().DatePicker()
.Name("myDataPicker")
.Value(DateTime.Now.Date)
.Format("dd/MM/yyyy")
.HtmlAttributes(new {style = "width: 150px;" })
)
I need to change the date of my element from javascript, and I'm doing it in this way
$("#myDataPicker").kendoDatePicker({
value: new Date(),
format: "dd/MM/yyyy", ( I have to do this because it doesn't remember the given format in the helper )
});
It works but this function changes some style in the element, in particular in the first span
k-input is added causing a padding issue and style has now a width:100%, not 150px as I set in the helper and I have when the page is just opened
so before
<span class="k-widget k-datepicker k-header" style="width: 150px;">
after
<span class="k-widget k-datepicker k-header k-input" style="width: 100%;">
I have to use an ugly workaround changing the class and style from jquery but I was wondering if there is a better solution
any help is appreciated
thank's
Mauro