Is there other way to have summary at grouping header other than using groupSummaryPos:['header']
? I am using jqGrid v4.6.0 and unfortunately I cannot upgrade to higher version.
I have a table that I implemented using jqGrid in my project. The gridOptions are very similar with the one mentioned in my previous question here
As you can see from the plunkr, the demo works fine and I can show summary on header. However, when I moved the code to my project, the summary always shows on footer. The only difference between my project and the plunkr code is in my project, I am using a reusable component that will initialize jqGrid. I have debugged the code to see if the groupSummaryPos = ['header']
being overridden somewhere in my project by that reusable component, but it gives me no luck.
So, I have decided to go for a workaround. I tried to a 'hack-move' by moving the summary footer DOM element to the grouping header, after the GRID_COMPLETE event, using
var footerContent = jQuery('.jqfooter').children;
jQuery('.jqgroup')[0].children[0].removeAttribute('colspan');
jQuery('.jqgroup')[0].appendChild(footerContent[0]); // till all columns
However, this doesn't work because the appendChild will move each column in random order (I'm not sure why).. In summary, I have tried to use the proper way, which is specifying groupSummaryPos: ['header']
in my colOptions, and also a 'really bad' hack way, but it's not working too.
Is there a possible way to move summary footer to group header without using groupSummaryPos?