Hello gents,
Is there a way to do a datetimepicker inside a kendo ui dropdown list . What i want to accomplish is this: have a select and the default option to be a date time picker and the other options to be some data that i bring via a .net controller.( i wanna do this dynamically for i don't know if i have data or not ).Also it must be a widget so that's why i attached the following code
I have tried the following :
<script>
(function () {
var kendo = window.kendo,
ui = kendo.ui,
Widget = ui.Widget,
CHANGE = "change";
var RangeSelector = Widget.extend({
init: function (element, options) {
var that = this;
debugger;
kendo.ui.Widget.fn.init.call(that, element, options);
that.template = kendo.template(that.options.template);
that._dataSource();
},
options: {
name: "RangeSelector",
autoBind: true,
template: "<ul><li id='default'/></li></ul>"
},
refresh: function () {
var that = this,
view = that.dataSource.view(),
html = kendo.render(that.template, view);
that.element.html(html);
},
_dataSource: function () {
var that = this;
// returns the datasource OR creates one if using array or configuration object
that.dataSource = kendo.data.DataSource.create(that.options.dataSource);
// bind to the change event to refresh the widget
that.dataSource.bind(CHANGE, function () {
that.refresh();
});
if (that.options.autoBind) {
that.dataSource.fetch();
}
}
});
ui.plugin(RangeSelector);
})(jQuery);
</script>
<script>
$("#rangeSelector").kendoRangeSelector({
dataSource: ["item1", "item2", "item3"]
});
$('#default').kendoDateTimePicker({
format: "MM/dd/yyyy hh:mm tt"
});
</script>