tonytomov / jqGrid

jQuery grid plugin

Home Page:www.trirand.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`footerrow` problem using `setFrozenColumns`, `groupingView` and `height:'auto'`

parallels999 opened this issue · comments

https://jsfiddle.net/6pa0ts37/3/

image

UPDATE:
https://jsfiddle.net/79qz5gym/, I fix it by adding:

onClickGroup: () => {
  grid.destroyFrozenColumns();
  grid.setFrozenColumns();
}

UPDATE 2: Fixed on core

Please, read the docs for the limitations when frozen columns are on

hi @tonytomov , thanks for the quick answer

is this a frozen columns limitation too?
when the grid has no visibility, setGroupHeaders set no text on the first header, with visibility works as expected
https://jsfiddle.net/ocxyrpb8/1/
image

This could be fixed easy adding the next code on groupingToggle

if(frz && $t.p.height === 'auto'){
  $t.grid.fbDiv.height($($t).height());
  if($t.grid.fsDiv) {
    // the size of the borders would be needed, maybe 2px?? also scrollbar height
    $t.grid.fsDiv.css('top', ($t.grid.fbDiv.position().top + $($t).height()) + 'px');
  }
}

Here:

jqGrid/js/grid.grouping.js

Lines 274 to 275 in 630d3d8

}
$($t).triggerHandler("jqGridGroupingClickGroup", [hid , collapsed]);

WORKING DEMO: https://jsfiddle.net/6busLny4/

setFrozenColumns as described into the docs should be called as last method. In one of your example
https://jsfiddle.net/ocxyrpb8/1/
you call it before grouping which causes the problem. If you call frozen columns after grouping the result will be as expected.

As for your recommendation I will check it - thanks.

https://jsfiddle.net/ocxyrpb8/1/
you call it before grouping which causes the problem, If you call frozen columns after grouping the result will be as expected

I already changed the order, it's the same result
DEMO: https://jsfiddle.net/gmezbxfL/1/
image

As last method- after visibility setting

$('#jqGridParent').css('visibility','');

As last method- after visibility setting

That is the problem that I describe, when the grid does not have visibility, frozen does not work correctly, I have a hidden grid, and when the grid is displayed the header has no text,

when the grid has no visibility, setGroupHeaders set no text on the header,

I did add the $('#jqGridParent').css('visibility',''); and <div id="jqGridParent" style="visibility:hidden;"> to show the problem,
Of course without these changes it works correctly, even if I put it after $('#jqGridParent').css('visibility','');, but in my case I have tabs and the grid is hidden until the user activates the tab

Thanks. I have fixed the visibility problem.

Your fix for height auto isn't enough - in your example try to resize some column - the footer text disappear.
This also is another bug independent if grouping is on or off

Thanks, looks great to me, I hope the change doesn't affect anyone.

Your fix for height auto isn't enough
... in your example try to resize some column - the footer text disappear.

it is because text was added by brute force directly in the frozen footer with

$('.frozen-sdiv').find('td').html('test'); // set values on the frozen TDs

There is no bug on resize, look: https://jsfiddle.net/jbu4wak0/

Thanks. I have seen this minute after writing the answer, and have decision to leave it - to remember me that I should read the code carefully.

Thank you again for your investigations and fixes.