Describe the bug
If I setup groupHeader function when I ma grouping by two fields groupBy : [ "agreement_id", "period_id" ] then that function is called twice: once for each field.
I agree with this behavior because I have only one function for all fields. But when I set a different header for each level of group I pass the array:
groupHeader : [ function( value, count, data, group ){
console.log( value, group ),
} ]
As you can see I setup only one function for the first field, but this function is called also for the second field. I expect here that for the second field will be called some default function, because I do not provide any function for it
Tabulator Info
The way I see it by setting groupHeader you have chosen to 'own' the formatting, so it is up to you to specify it all the way through. Just my 2 cents worth.
What happens if you use:
function(value, count, data){
return value;
}
for the second function?
function(value, count, data){ return value; } this variant works fine.
But next questions appear: If I group by three fields and provide the array of only two functions to groupHeader:
Only first function from array will be called for third field?
Only second function from array will be called for third field?
Both first two provided functions from array will be called for third field?
Only first function from array will be called for third, second and first groupBy field?
Probably this should be an exception if provided array has less functions than required....
Not sure.
The answer is here:
https://github.com/olifolkerd/tabulator/blob/master/src/js/modules/group_rows.js
I just haven't figured out yet:)
I agree with @aklaver once you have chosen to use the groupHeader option you have replaced the default functionality.
I also agree with @KES777 that in that instance there should be a console warning if one is not defined, i will look into this for the 4.3 release.
Thanks for the input.
Cheers
Oli :)
I have pushed an update to the 4.4 branch which includes a console warning for this issue.
Cheers
Oli :)