I have two columns grouped under a single header. Resizing any column causes the headers to become mismatched from the rest of the grid. NOTE: This error occurs in your demo as well…
https://www.gridphp.com/demo/demos/appearance/group-headers.php
Column definitions…
$col = array(); $col["title"] = "Contract"; // caption of column $col["name"] = "msContrHeads"; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias) $col["width"] = "60"; $col["hidden"] = false; $col["search"] = false; // this column is not searchable $col["editable"] = true; // this column is editable $col["editrules"] = array("number"=>true); $colsMS[] = $col; $col = array(); $col["title"] = "Current"; // caption of column $col["name"] = "msCurrHeads"; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias) $col["width"] = "60"; $col["hidden"] = false; $col["search"] = false; // this column is not searchable $col["editable"] = true; // this column is editable $col["editrules"] = array("number"=>true); $colsMS[] = $col; SETTING THE GROUP HEADERS...
$g2->set_group_header( array( "useColSpanStyle"=>true, // NOTE: problem occurs whether this is true or false "groupHeaders"=>array( array( "startColumnName"=>'msContrHeads', // group starts from this column "numberOfColumns"=>2, // group span to next 2 columns "titleText"=>'Head Counts' // caption of group header ) ) ) );
2 Answers
Yes, this issue exist. We’ll be reviewing this bug and update this ticket after some progress.
To fix this issue, you can set forceFit to false in grid options (set_options function)
$opt["forceFit"] = false;
Your Answer