Permalink
Browse files

We need firdt to destroy group header before to show/hide column and …

…the to restore it.
  • Loading branch information...
1 parent 3e776a5 commit 699d146da2610404778d62e948292770b259794f @tonytomov committed Oct 10, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 js/grid.base.js
View
@@ -2897,7 +2897,9 @@ $.jgrid.extend({
if (!$t.grid ) {return;}
if( typeof colname === 'string') {colname=[colname];}
show = show != "none" ? "" : "none";
- var sw = show === "" ? true :false;
+ var sw = show === "" ? true :false,
+ gh = $t.p.groupHeader && (typeof $t.p.groupHeader === 'object' || $.isFunction($t.p.groupHeader) );
+ if(gh) { $($t).jqGrid('destroyGroupHeader', false); }
$(this.p.colModel).each(function(i) {
if ($.inArray(this.name,colname) !== -1 && this.hidden === sw) {
$("tr",$t.grid.hDiv).each(function(){
@@ -2916,8 +2918,7 @@ $.jgrid.extend({
if(fndh===true) {
$($t).jqGrid("setGridWidth",$t.p.shrinkToFit === true ? $t.p.tblwidth : $t.p.width );
}
- if($t.p.groupHeader && (typeof $t.p.groupHeader === 'object' || $.isFunction($t.p.groupHeader) ) ) {
- $($t).jqGrid('destroyGroupHeader', false);
+ if( gh ) {
$($t).jqGrid('setGroupHeaders',$t.p.groupHeader);
}
});

0 comments on commit 699d146

Please sign in to comment.