Hi,
I have 2 fields FromDate and Todate
based upon these filters by default filter the records and dispaly it on kendo grid
could you please help me
@{
Layout = null;
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AngularJS: Input Type Date Set Date</title>
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.226/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.226/styles/kendo.bootstrap.min.css" />
<script src="//kendo.cdn.telerik.com/2016.1.226/js/jquery.min.js"></script>
<script src="//kendo.cdn.telerik.com/2016.1.226/js/angular.min.js"></script>
<script src="//kendo.cdn.telerik.com/2016.1.226/js/kendo.all.min.js"></script>
<script type="text/javascript">
var app = angular.module('MyApp', ["kendo.directives"])
app.controller('MyController', function ($scope) {
var firstDay = new Date(new Date().getFullYear(), new Date().getMonth(), 1);
var lastDay = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0);
$scope.StartDate = firstDay;
$scope.EndDate = lastDay;
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
transport: {
read: "/Home/GetAll/",
},
pageSize: 20
},
height: 550,
groupable: true,
sortable: true,
columns: [
{
field: "Id",
title: "Id",
width: "10%",
}, {
field: "Name",
title: "Name",
width: "15%",
}, {
field: "Is Active",
title: "Is Active",
}]
});
});
});
</script>
</head>
<body ng-app="MyApp" ng-controller="MyController">
Start Date : <input type="date" ng-model="StartDate" />
End Date : <input type="date" ng-model="EndDate" />
<div id="example">
<div id="grid"></div>
</div>
</body>
</html>