Hi,
I have 3 filters after clicking of Go button values are not coming to controller (breakoint is not coming to controller)
I have shared you my code
pelase be look and suggest me
Thanks
[HttpPost]
public JsonResult Edit(int PageNo, int PageSize,int ItId, DateTime? Fdate, DateTime? tdate)
{
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Index</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.js"></script>
<script src="~/masters/dirpagination.js"></script>
<script type="text/javascript">
var app = angular.module('MyApp', ['angularUtils.directives.dirPagination']);
app.controller('MyController', function ($scope, $window, $filter) {
GetItems();
$scope.items = [];
$scope.PageIndex = 1;
$scope.RecordCount = 0;
$scope.PageSize = 10;
$scope.SearchTerm = "";
$scope.ReverseSort = false;
$scope.SortDirection = "ASC";
$scope.GetCustomers = function (index) {
PopulateCustomer(index);
}
function PopulateCustomer(index) {
$scope.PageIndex = index;
$scope.items = [];
$http.get("/Home/GetCustomers/", {
params: {
PageNo: $scope.PageIndex,
PageSize: $scope.PageSize,
searchTerm: $scope.searchTerm,
sortDirection: $scope.SortDirection,
sortColumn: $scope.SortColumn
}
}).then(function (response) {
$scope.Customers = response.data.Customers;
$scope.RecordCount = response.data.TotalRecords;
}).then(function (response) { });
}
$scope.Go = function () {
scope.GetCustomers($scope.PageIndex);
}
$scope.GetCustomers($scope.PageIndex);
$scope.Go = function () {
var Id1 = $scope.Item;
var eId = $scope.Employee;
var fd = $scope.FDate.toISOString().split('T')[0];
var td = $scope.TDate.toISOString().split('T')[0];
$.post("/Home/Edit/", { ItId: Id1, empId: eId, Fdate: fd, tdate: td }, function (r) {
});
}
});
</script>
</head>
<body ng-app="MyApp" ng-controller="MyController">
<div class="form-horizontal">
<div class="form-group">
<label for="ID" class="control-label col-xs-2">Item</label>
<div class="col-md-2">
<select style="display: inline" data-ng-model="Item" class="form-control" data-ng-options="p.Id as p.Name for p in Items">
<option value="">-- Select Item --</option>
</select>
</div>
<label for="ID" class="control-label col-xs-2">Employee</label>
<div class="col-md-4">
<label for="FDate">From Date</label>
<input type="date" ng-model="FDate" id="FDate" name="FDate" class="form-control" required />
</div>
<div class="col-md-4">
<label for="lblTDate">To Date</label>
<input type="date" ng-model="TDate" id="TDate" name="TDate" class="form-control" required />
</div>
</div>
</div>
<div>
<button class="btn btn-success btn-sm" ng-click="Go()">
<span class="glyphicon glyphicon-ok"></span>Submit
</button>
</div>
<div class="container" id="printarea">
<table class="table table-bordered">
<tr class="success">
<th>Id</th>
<th>Item</th>
<th></th>
</tr>
<tr dir-paginate="item in items|itemsPerPage:PageSize">
<td>{{item.ItemId}}</td>
<td>{{item.ItemName}}</td>
</tr>
</table>
<dir-pagination-controls max-size="PageSize" direction-links="true" boundary-links="true"
on-page-change="GetCustomers(newPageNumber)">
</dir-pagination-controls>
</div>
</body>
</html>