From ecf69c91bbd31d5ff5dea51f4ccc4a74325a0e39 Mon Sep 17 00:00:00 2001 From: TreetopFlyer Date: Sat, 22 May 2021 21:19:55 -0400 Subject: [PATCH] propertly collect sum indicies --- index.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index b90b398..8986b61 100755 --- a/index.html +++ b/index.html @@ -179,7 +179,9 @@ var Pivot = { for(let i=0; i N.Create({Row:r})); Pivot.Init = ()=>{}; @@ -387,20 +389,21 @@ let ElForm = props => let used = N.Step(Pivot.Proto, "used")||[]; let unused = N.Step(Pivot.Schema, "label").filter( columnLabel => !N.Step(columnLabel, "used", false) ); - let indicies = used.map(node=>node.Meta.Index); - + let indiciesPivot = used.map(node=>node.Meta.Index); + let indiciesSum = (N.Step(Pivot.Schema, "sum")||[]).map(n=>n.Meta.Index); + var action; - if(indicies.length) + if(indiciesPivot.length) { action = h("div", null, [ h("span", null, "Build"), h("button", {onClick:e=> { N.Disconnect(Pivot.Proto, null, "used"); - Pivot.Create(indicies, [3, 4]); + Pivot.Create(indiciesPivot, indiciesSum); Render(); } - }, indicies) + }, "Create Pivot") ]); } else -- 2.34.1