free-jqgrid / jqGrid

jQuery grid plugin
https://github.com/free-jqgrid/jqGrid
Other
478 stars 196 forks source link

Frozen columns, inlineNav, Group Header issues #465

Open Jaredmlipp opened 5 years ago

Jaredmlipp commented 5 years ago

Hello, I am having issues with free jqrid 4.15.5. The problems are that some columns are stacking on top of each other. this cause some weird glitches because the ones that are stacked are the ones that are supposed to be frozen but it leaves a remnant of the frozen column at the very top. Then because they are stacking it also has another problem of columns not being in the correct place because of the stacked columns. i have looked through a lot of stack overflow and haven't found a fix to my problem. Here is a jsfiddle so you can see what issues I am having as this is kind of hard to explain all the issues I am having. Thank you for your time.

https://jsfiddle.net/jaredml/r4bda5pL/18/

OlegKi commented 5 years ago

I don't know any way to create good code of setFrozenColumns and setGroupHeaders to support multilevel column grouping in combination with frozen columns. In the most practical cases one can still add some lines of code to fix the problem with height of rowspan.

For example in your case I made simple modification of your code:

  1. You should use setFrozenColumns after all setGroupHeaders
  2. You can fix the problem with the height of frozen headers by usage the following code
    var $frozenDiv = $("#grid")[0].grid.fhDiv;
    $frozenDiv.children("table.ui-jqgrid-htable")
    .children("thead")
    .children("tr.jqg-second-row-header")
    .children("th[rowspan]")
    .height($frozenDiv.height())
    });

    See results on https://jsfiddle.net/OlegKi/upg6b2yd/12/, where I added the following CSS rule to increase the padding in column headers

    .ui-jqgrid .ui-jqgrid-htable th.ui-th-column-header,
    .ui-jqgrid .ui-jqgrid-htable th.ui-th-column {
    padding: 0.5em;
    }