Repository navigation
Fix: la media nelle tabelle non segue la selezione - #1925
Open
Andrea-Bruno wants to merge 1 commit into
Open
Andrea-Bruno wants to merge 1 commit into
Andrea-Bruno wants to merge 1 commit into
Conversation
The backend already exposed the avg-results operation, but the footer refresh for a selection only asked for summable-results, so the average kept showing the value for the whole dataset. The refresh now requests both groups and applies them in the same order as footerCallback.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ciao e grazie per il progetto.
Ho letto la issue #1519 e ho capito cosa non va. Nelle tabelle dell'elenco esiste un'opzione che fa vedere i totali solo alle righe che hai scelto tu. Le somme seguono bene questa scelta, ma la media no: resta sempre quella di tutte le righe, anche quando ne selezioni solo una parte.
Il motivo e' semplice. Il programma che sta sul server sa gia' calcolare sia le somme sia le medie per un gruppo di righe scelto, e mette a disposizione due strade separate per chiederglieli. La pagina pero', quando cambi la selezione, va a chiedere solo le somme e non chiede mai le medie. Cosi' le medie restano quelle vecchie, calcolate su tutto l'elenco.
La correzione che ho fatto e' piccola e sta tutta nella pagina. Ora, quando cambi la selezione, la pagina chiede insieme sia le somme sia le medie per le righe scelte, e poi le mostra entrambe nello stesso ordine in cui le mostrava prima. Cosi' la media si muove insieme alla selezione, come ci si aspetta.
Non ho cambiato niente nel calcolo che c'e' sul server, perche' era gia' giusto: mancava solo la richiesta dalla pagina.