0

Firstly take a look at the data I'm trying to show on the pivotgrid:https://api.myjson.com/bins/1a46si, as you can see the items should be nested based on "L1~L8", and the value it should display on the aggregate is the "SUM". As an example, a "L1" item will have a value on L1, but L2~L8 will be empty, and its sum value is the sum of all its "children" (this calc is already being sent from the server, so the pivot grid only need to show it).

Right now im doing it like this:

        {
        xtype: 'pivotgrid',
        scrollable: 'both',
        matrix: {
            compactViewColumnWidth: 600,
            textGrandTotalTpl: 'Value',
            textRowLabels: 'Name',
            viewLayoutType: 'compact',
            store: 'myPivotStore',
            leftAxis: [
                {
                    dataIndex: 'NAME_L1'
                },
                {
                    dataIndex: 'NAME_L2'
                },
                {
                    dataIndex: 'NAME_L3'
                },
                {
                    dataIndex: 'NAME_L4'
                },
                {
                    dataIndex: 'NAME_L5'
                },
                {
                    dataIndex: 'NAME_L6'
                },
                {
                    dataIndex: 'NAME_L7'
                },
                {
                    dataIndex: 'NAME_L8'
                }
            ],
            aggregate: {
                dataIndex: 'SUM'
            }
        }
    }

The problem is that the pivot grid is showing these data that don't have any value on L2~L8 as '(blank)', another problem is the aggregate summing its children, I already tried to get the SUM value of the record with a custom aggregator but I can't find the right record which corresponds to the current aggregate.

fiddle example: https://fiddle.sencha.com/#view/editor&fiddle/2qrf

Image result:enter image description here

Do I need to change the way I'm mapping the model? Sorry if I wasn't clear enough.

Matheus Hatje
  • 987
  • 1
  • 7
  • 18
  • Can you present in fiddle/ some image what you want to achieve? Do you want to aggregate all "SUM" parameters? – norbeq Mar 21 '19 at 22:46
  • Updated with fiddle example, i "just" need a way to remove those (blank) field, i tried to make a label filter, for each leftAxis (!= '(blank)'), but doing this some other field disapeared too – Matheus Hatje Mar 22 '19 at 11:13
  • For some reason, sencha fiddle don't work with pivotgrid - `Unrecognized alias: widget.pivotgrid` – norbeq Mar 22 '19 at 21:41
  • I was getting this error too, try to load another pivot grid fiddle and then load mine on the same browser page, I added an image of the result. – Matheus Hatje Mar 22 '19 at 22:45

0 Answers0