This commit is contained in:
2018-03-04 13:43:58 -05:00
parent c425c1542f
commit 2a3b0509a8
6 changed files with 100 additions and 36 deletions

View File

@@ -20,6 +20,10 @@ export class GameGridComponent implements OnInit {
rawGamesContent;
gamesData;
queryFilters;
querryPage;
queryOrder;
constructor(
private route: ActivatedRoute,
private gamesService: GamesService
@@ -28,33 +32,36 @@ export class GameGridComponent implements OnInit {
}
ngOnInit() {
this.getGamesList();
}
getGamesList(): any{
this.gameListSubscription = this.gamesService.getGames( ).subscribe( data => {
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.gamesData = data.games;
//var tempItemContent = [];
/* parse out just the input data and set that in object array */
/*for( var key in data['ContentBlocks'] ){
console.log( data['ContentBlocks'][key]['Type'] );
if( data['ContentBlocks'][key]['Type'] == "ItemSelectionSetting" ){
tempItemContent.push( data['ContentBlocks'][key]['Content'] );
}
}
this.formItemContent = tempItemContent;
*/
});
}
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);
}
@@ -66,13 +73,21 @@ export class GameGridComponent implements OnInit {
renderGridItems(lastItem: boolean) {
if (lastItem) {
$('.grid').masonry({
columnWidth: '.grid-sizer',
columnWidth: 250,
itemSelector: '.grid-item',
percentPosition: true
gutter: 10
});
}
}
myFunc(){
$('.grid').masonry('destroy')
this.getGamesList2();
}