how to refresh column grouping data when we reload the grid / bind new data to grid after first load
Columns ( including column grouping ) information is stored in colModel and grid data is stored in dataModel.data
To set/ refresh new columns
grid.refreshCM( new colModel )
set/bind new data
grid.option('dataModel.data', new data)
grid.refreshDataAndView()
how to rename column grouping column name
get reference to the desired column and set
column.title = new title
provide title/label to first column on grand summary row?
Titles can be defined in summary data itself as in this example:
https://paramquery.com/pro/demos/summary_jsonsummaryData: [
{ rank:'Total', summaryRow: true, pq_fn:{revenues:'sum(C:C)', profits:'sum(D:D)', diff:'sum(E:E)' }},
{ rank:'Average', summaryRow: true, pq_fn:{revenues:'average(C:C)', profits:'average(D:D)', diff:'average(E:E)' }},
{ rank:'Std deviation', summaryRow: true, pq_fn:{revenues:'stdev(C:C)', profits:'stdev(D:D)', diff:'stdev(E:E)' }}
],
column.render can be used for bit more advanced cases.
The pivot works fine and successfully set column grouping and row grouping for the first load of data into grid. However, when I try to submit the search and refresh the grid with new data, the row grouping data has changed as per new data but for column grouping (both column name + data) does not get change based upon new data. What option does we need to set so even column grouping also refresh when we have new data to bind.
If you want to bind new data in a pivot grid, then you would need to turn off the pivot first. Pivot can be turned on again after setting new data.
grid.Group({pivot: false}) //turn off pivot.
//bind new dataset in grid
grid.Group({pivot: on}) //turn on pivot.
Column grouping is auto generated by the pivot grid depending upon its data and you don't need to do it manually.
I want to provide custom name to aggregate column (column grouping aggregate columns) and set custom value/ label for grant summary row on pivot grid. Can you suggest what is the setting to perform this?
If you want to make any changes/ customizations in auto generated colModel of pivot grid, then pivotCM event is used.
e.g. in this example:
https://paramquery.com/pro/demos/pivot_total pivotCM event is used to add css classes to aggregate columns.
If you are facing any issues, please share a jsfiddle/ plnkr.