From 07c9ae6724edcdbd104ddabaceda38a7b2d65757 Mon Sep 17 00:00:00 2001 From: Petr Vecera Date: Tue, 22 Aug 2017 01:13:27 +0200 Subject: [PATCH] Load the VM store after correct filter is applied --- App/app/view/charts/PlayerVsPlayerViewController.js | 7 ++----- App/metadata/view/charts.PlayerVsPlayerViewModel | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/App/app/view/charts/PlayerVsPlayerViewController.js b/App/app/view/charts/PlayerVsPlayerViewController.js index ef58369..b9fd504 100644 --- a/App/app/view/charts/PlayerVsPlayerViewController.js +++ b/App/app/view/charts/PlayerVsPlayerViewController.js @@ -122,13 +122,8 @@ Ext.define('Enif.view.charts.PlayerVsPlayerViewController', { const playerData = Ext.getStore('SortedPlayerData').getData(); if (!playerData) return; - const gameStore = Ext.getStore('GameRawData'); - gameStore.clearFilter(); - - let thisStoreData = []; - const VM = this.getViewModel(), playerId = VM.get('firstPlayerId'), playerId2 = VM.get('secondPlayerId'), @@ -138,6 +133,8 @@ Ext.define('Enif.view.charts.PlayerVsPlayerViewController', { //init filtering of the grid store this.filterMatchesStore(); + const gameStore = VM.getStore('playedGames'); + let score = 0, wins = 0, loses = 0, diff --git a/App/metadata/view/charts.PlayerVsPlayerViewModel b/App/metadata/view/charts.PlayerVsPlayerViewModel index fc56f9e..dc7077b 100644 --- a/App/metadata/view/charts.PlayerVsPlayerViewModel +++ b/App/metadata/view/charts.PlayerVsPlayerViewModel @@ -89,13 +89,8 @@ "const playerData = Ext.getStore('SortedPlayerData').getData();", "if (!playerData) return;", "", - "const gameStore = Ext.getStore('GameRawData');", - "gameStore.clearFilter();", - "", - "", "let thisStoreData = [];", "", - "", "const VM = this.getViewModel(),", " playerId = VM.get('firstPlayerId'),", " playerId2 = VM.get('secondPlayerId'),", @@ -105,6 +100,8 @@ "//init filtering of the grid store", "this.filterMatchesStore();", "", + "const gameStore = VM.getStore('playedGames');", + "", "let score = 0,", " wins = 0,", " loses = 0,",