We can reset the value of kendo date picker by following two method
1. using the date picker id,
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled</title>
-
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.common.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.rtl.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.default.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.mobile.all.min.css">
-
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2016.1.412/js/angular.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2016.1.412/js/jszip.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2016.1.412/js/kendo.all.min.js"></script></head>
- <body>
- <div id="example">
- <input id="to" data-role="datepicker"
- data-bind="visible: isVisible"
-
- style="width: 100%">
- <br/>
- <button class=k-button data-bind="click:ResetControl" >Clear Search</button>
- </div>
-
-
- <script>
- var viewModel = kendo.observable({
-
- isVisible: true,
- ResetControl:function(e)
- {
-
- e.preventDefault();
- $("#to").val('')
-
- }
-
- });
- kendo.bind($("#example"), viewModel);
- </script>
- </body>
- </html>
2. using CSS class
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled</title>
-
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.common.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.rtl.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.default.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.mobile.all.min.css">
-
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2016.1.412/js/angular.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2016.1.412/js/jszip.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2016.1.412/js/kendo.all.min.js"></script></head>
- <body>
- <div id="example">
- <input id="to" data-role="datepicker"
- data-bind="visible: isVisible"
-
- style="width: 100%">
- <br/>
- <button class=k-button data-bind="click:ResetControl" >Clear Search</button>
- </div>
-
-
- <script>
- var viewModel = kendo.observable({
-
- isVisible: true,
- ResetControl:function(e)
- {
-
- e.preventDefault();
-
- $(".k-datepicker input").val('')
- }
-
- });
- kendo.bind($("#example"), viewModel);
- </script>
- </body>
- </html>