Hi.
I have the need to add an extra data column to the start of the Pivot table. This would be in a column after the initial grouping data.
Is this possible? Would I need to add some type of custom column by manipulating the DOM or can I do it with the API somehow.
Also if I do this, how can I get access to the raw dataset so I can pull out the data I need and display it in this column?
Thanks.
Maria
December 2, 2015, 8:22am
2
Hi,
there is onHeaderInit event that is called after Pivot calculated columns. The event handler takes an array with number columns as a parameter and this array can be customized:
view: "pivot",
on:{
onHeaderInit: function(columns){
var colConfig = {
id: "myColumn",
header:"my column",
template: function(rowData){
return "test";
}
};
columns.splice(0, 0,colConfig);
}
},