working updates

This commit is contained in:
2018-03-31 17:35:30 -04:00
parent 2a3b0509a8
commit 7ad3c6b93a
12 changed files with 3329 additions and 39 deletions

View File

@@ -20,9 +20,13 @@ export class GameGridComponent implements OnInit {
rawGamesContent;
gamesData;
queryFilters;
querryPage;
queryOrder;
queryFilters = "";
querryPage = 1;
queryOrder = "Title";
queryRecordMax = 10;
showNext = true;
showBack = false;
constructor(
private route: ActivatedRoute,
@@ -36,31 +40,25 @@ export class GameGridComponent implements OnInit {
}
getGamesList( ): any{
getGamesList(): any{
this.queryFilters = "Played,eq,true";
this.querryPage = 1;
this.queryOrder = "Title";
this.gameListSubscription = this.gamesService.getGames( this.queryFilters, this.querryPage, this.queryOrder ).subscribe( data => {
console.log( data );
this.gameListSubscription = this.gamesService.getGames( this.queryFilters, this.querryPage, this.queryOrder, this.queryRecordMax ).subscribe( data => {
this.gamesData = data.games;
if( this.gamesData.length < this.queryRecordMax ){
this.showNext = false;
}else{
this.showNext = true;
}
if( this.querryPage != 1 ){
this.showBack = true;
}else{
this.showBack = false;
}
});
}
getGamesList2( ): any{
this.queryFilters = "Played,eq,true";
this.querryPage = 2;
this.queryOrder = "Title";
this.gameListSubscription = this.gamesService.getGames( this.queryFilters, this.querryPage, this.queryOrder ).subscribe( data => {
console.log( data );
this.gamesData = data.games;
});
}
isEmptyObject(obj) {
return (obj != undefined);
@@ -84,10 +82,13 @@ export class GameGridComponent implements OnInit {
}
myFunc(){
$('.grid').masonry('destroy')
this.getGamesList2();
nextPage(){
this.querryPage++;
this.getGamesList();
}
backPage(){
this.querryPage--;
this.getGamesList();
}