akashana
Newbie
Posts: 23
|
|
« on: March 20, 2019, 07:52:30 PM » |
|
Hi,
Pivot grid was generated perfectly as shown in attachment with the following source data. [ { "Name": "Employee 1001", "Period": "Jan-18", "Amount": 6504 }, { "Name": "Employee 1001", "Period": "Jan-18", "Amount": 4648 }....]
However, I am stuck at displaying column total and row total i.e. Total for each month and Total for each employee. Can you please help ?
Regards,
|
|
|
Logged
|
|
|
|
akashana
Newbie
Posts: 23
|
|
« Reply #1 on: March 20, 2019, 07:56:43 PM » |
|
Somehow the attachment was missing in my earlier post.
|
|
|
Logged
|
|
|
|
akashana
Newbie
Posts: 23
|
|
« Reply #2 on: March 25, 2019, 02:53:03 AM » |
|
Hi,
Any update on this ?
Regards,
|
|
|
Logged
|
|
|
|
jarry
|
|
« Reply #3 on: March 25, 2019, 08:27:01 AM » |
|
What is the 'column total and row total'? Please describe it much clearly.
|
|
|
Logged
|
|
|
|
akashana
Newbie
Posts: 23
|
|
« Reply #4 on: March 25, 2019, 09:07:04 PM » |
|
Hi,
Please see the attached image for totals.
Regards,
|
|
|
Logged
|
|
|
|
jarry
|
|
« Reply #5 on: March 26, 2019, 12:44:32 AM » |
|
The 'aggregate' property is available to set the summary row and column. Make sure to download the newest file from https://www.jeasyui.com/extension/pivotgrid.phppivot:{ rows:['Country','Category'], columns:['Color'], values:[ {field:'Price',op:'max'}, {field:'Discount',op:'sum'} ], aggregate: { column: { field: '_total', title: 'Total', width: 100, align: 'right' }, footer: { frozenColumnTitle: 'Total' } } },
|
|
|
Logged
|
|
|
|
akashana
Newbie
Posts: 23
|
|
« Reply #6 on: March 27, 2019, 05:24:13 AM » |
|
Hi,
I downloaded the latest file but it seems that aggregate functionality doesn't work. Even in the sample file pivotgrid.html, the code for totals is not included.
Can you please share a working example ?
Thanks & Best Regards,
|
|
|
Logged
|
|
|
|
jarry
|
|
« Reply #7 on: March 27, 2019, 08:48:07 AM » |
|
|
|
|
Logged
|
|
|
|
akashana
Newbie
Posts: 23
|
|
« Reply #8 on: March 27, 2019, 07:25:29 PM » |
|
Hi, Thanks. But this aggregate property didn't work in the version I downloaded from https://www.jeasyui.com/extension/downloads/jquery-easyui-pivotgrid.zip. Did I download it from wrong location ? Satisfied with your controls and bought one commercial license just now.One question. If there is only one dimension for aggregation, can I hide it ? See image Best Regards,
|
|
|
Logged
|
|
|
|
akashana
Newbie
Posts: 23
|
|
« Reply #9 on: March 27, 2019, 08:08:05 PM » |
|
Hi,
Noticed one small issue. FrozenColumnTitle is not displayed. Please see image.
Regards,
|
|
|
Logged
|
|
|
|
|
akashana
Newbie
Posts: 23
|
|
« Reply #11 on: March 28, 2019, 05:00:39 AM » |
|
Hi,
It's done. I handled using the following code.
onLoadSuccess: function(){ $('#pg').pivotgrid('collapseAll'); var opt = $('#pg').pivotgrid('options'); var rows = opt.pivot.rows; var header = rows[0]; var title = $(this).data('datagrid').dc.header1.find('.datagrid-cell>span:first'); title.html('<span style="font-weight:bold">'+ header +'</span>'); }
You may close the ticket.
Regards,
|
|
|
Logged
|
|
|
|
nijino
Newbie
Posts: 1
|
|
« Reply #12 on: August 12, 2019, 07:31:38 PM » |
|
Hello,
i download jquery-easyui-pivotgrid.zip and test it. the total is the correct value * numbers of rows
jquery.pivotgrid.js i modify the line #123, footerRow[fields] = value / opts.pivot.rows.length;
Please help to check if this the correct fix.
Thanks.
|
|
|
Logged
|
|
|
|
jarry
|
|
« Reply #13 on: August 13, 2019, 01:16:17 AM » |
|
No problem with this code. footerRow[fields[i]] = value;
|
|
|
Logged
|
|
|
|
|