Declined
Last Updated: 10 Aug 2015 16:27 by ADMIN
Vasim
Created on: 31 Jul 2015 20:58
Category: Kendo UI for jQuery
Type: Feature Request
1
DatePicker option to use native type="date" but retain events and API
Currently to use the native mobile Date Picker I have to add if statement like so:

@if (Request.Browser.IsMobileDevice)
{
	@Html.TextBoxFor(model => model.DateTime, new {type = "date", @class = "k-textbox k-input", @onchange = "dataChanged()" })
}
else
{
	@(Html.Kendo().DatePicker()
                                  .Name("DateTime")
                                  .Events(e => e.Change("dataChanged"))
                                  .HtmlAttributes(new {style = "width: 120px;"})
                                  .Value(Model.DateTime)
                   )
}

What's worse is now the data() method cannot be used to reference the Date Picker in JavaScript, thus, another if statement has to be used:

if ($("#isMobile").val() = 1) {
    var dateTime = $("#DateTime").val();
} else {
    var dateTime = $("#DateTime").data("kendoTimePicker").value();
}

It would be great if something like UseNative(true) could be used keeping the Kendo Date Picker API:

@(Html.Kendo().DatePicker()
     .Name("DateTime")
    .Events(e => e.Change("dataChanged"))
    .HtmlAttributes(new {style = "width: 120px;"})
    .Value(Model.DateTime)
    .UseNative(true)
)
2 comments
ADMIN
Telerik Admin
Posted on: 10 Aug 2015 16:27
The Kendo UI datepicker does not support 'native' mode on mobile devices, where you can resort to using input type=date as you did, Vasim. 

I am afraid that supporting native mode and retaining the events and APIs for the date picker is not possible, hence you should replace it with input type=date on mobile.
Vasim
Posted on: 01 Aug 2015 02:35
I would like to add that the Kendo DatePicker works great on mobile but the problem is the Phone/Tablet keyboard is in the way, thus, alternatively make it work on mobile without keyboard input maybe?