From c9ff3d5495b0229d837fa0ec23486cc7b6b191d0 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 28 Dec 2012 13:13:14 +0100 Subject: o Listing builds on the person view. --- src/main/webapp/apps/frontPageApp/frontPageApp.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/main/webapp/apps/frontPageApp') diff --git a/src/main/webapp/apps/frontPageApp/frontPageApp.js b/src/main/webapp/apps/frontPageApp/frontPageApp.js index d92a163..c4fa0cc 100644 --- a/src/main/webapp/apps/frontPageApp/frontPageApp.js +++ b/src/main/webapp/apps/frontPageApp/frontPageApp.js @@ -1,11 +1,11 @@ 'use strict'; -var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'personService']).config(function ($routeProvider, $locationProvider) { +var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'person']).config(function ($routeProvider, $locationProvider) { $routeProvider. when('/', {controller: FrontPageCtrl, templateUrl: '/apps/frontPageApp/frontPage.html?noCache=' + noCache}); }); -function FrontPageCtrl($scope, $http, PersonService) { +function FrontPageCtrl($scope, $http, Person) { $scope.persons = []; $scope.pagingOptions = { @@ -19,6 +19,8 @@ function FrontPageCtrl($scope, $http, PersonService) { data: 'persons', displayFooter: true, enablePaging: true, + enableRowReordering: false, + enableColumnReordering: false, showFilter: false, showColumnMenu: false, canSelectRows: false, @@ -41,7 +43,8 @@ function FrontPageCtrl($scope, $http, PersonService) { $scope.setPagingData = function(data, page, pageSize){ // $scope.persons = data.slice((page - 1) * pageSize, page * pageSize); $scope.persons = data; - $scope.personsGridOptions.totalServerItems = data.length; +// $scope.personsGridOptions.totalServerItems = data.length; + window.x = $scope.personsGridOptions; if (!$scope.$$phase) { $scope.$apply(); } @@ -50,7 +53,7 @@ function FrontPageCtrl($scope, $http, PersonService) { $scope.getPagedDataAsync = function (pageSize, page/*, searchText*/) { setTimeout(function () { - PersonService.query({startIndex: page * pageSize, count: pageSize}, function (persons) { + Person.query({startIndex: page * pageSize, count: pageSize}, function (persons) { $scope.setPagingData(persons, page, pageSize); }); }, 100); @@ -60,9 +63,9 @@ function FrontPageCtrl($scope, $http, PersonService) { $scope.getPagedDataAsync($scope.pagingOptions.pageSize, $scope.pagingOptions.currentPage); }, true); - $http.get('/resource/core/person-count').success(function(count) { - $scope.pagingOptions.totalServerItems = count; - - $scope.getPagedDataAsync($scope.pagingOptions.pageSize, $scope.pagingOptions.currentPage); - }); +// $http.get('/resource/core/person-count').success(function(count) { +// $scope.pagingOptions.totalServerItems = count; +// +// $scope.getPagedDataAsync($scope.pagingOptions.pageSize, $scope.pagingOptions.currentPage); +// }); } -- cgit v1.2.3