我正在处理角度应用程序,我正在使用<a class="colorbox cboxElement" href="http://example.com">Diablo</a>
进行网格功能,但我遇到了两个问题。
这是屏幕截图
JS文件如下:
ng-table
Html如下
app.controller('AllJobListController', function
($scope, $http, $location, $filter, NgTableParams, jobService, ShareData, $sce) {
loadAllJobRecords();
GetFilterData();
function GetFilterData() {
var promiseFilterData = jobService.GetFilterData();
promiseFilterData.then(function(pl) {
$scope.FilterData = pl.data;
});
}
$scope.viewFilter = function () {
$scope.filters = {
Staff: $scope.FilterData.Staff == undefined ? null : $scope.FilterData.Staff,
Priority: $scope.FilterData.Priority == undefined ? null : $scope.FilterData.Priority,
Manager: $scope.FilterData.Manager == undefined ? null : $scope.FilterData.Manager,
Status: $scope.FilterData.Status == undefined ? null : $scope.FilterData.Status
}
$scope.tableParams.filter($scope.filters);
};
$scope.search = '';
function loadAllJobRecords() {
$("#divLoading").show();
var promiseGetAllJobs = jobService.GetAllJobs();
promiseGetAllJobs.then(function (pl) {
$("#divLoading").hide();
$scope.Jobs = pl.data;
$scope.JobTitle = "All Engagements";
$scope.Action = $sce.trustAsResourceUrl("/Job/ExportAllJobRecords");
// $scope.Action = "/Job/ExportAllJobRecords";
$scope.tableParams = new NgTableParams({
page: 1, // show first page
count: 10, // count per page
sorting: {
JobNum: 'asc' // initial sorting
},
filter: $scope.search
},
{ dataset: pl.data },
{
total: pl.data.length,
getData: function ($defer, params) {
var filteredData = params.filter() ? $filter('filter')(pl.data, params.filter()) : pl.data;
var orderedData = params.sorting() ? $filter('orderBy')(filteredData, params.orderBy()) : filteredData; params.total(filteredData.length);
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
}
});
},
function (errorPl) {
$scope.error = errorPl;
});
}
});
我搜索了过滤器问题,但无法找到解决方法。