Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
JQGridState + JQGrid.min : can't hide/show more than the first column
04/11/2010
22:07
Avatar
fredpeaks
New Member
Members
Forum Posts: 1
Member Since:
04/11/2010
sp_UserOfflineSmall Offline

Hello everyone!

Firstly i would like to thanks the authors of JQGrid, this amazing plugin!! I've discovered it a few days ago and i don't have the english words (i'm french Laugh) to tell you how much this is good. Thanks a lot!

I've found a little problem when using it with JQGridState (1.1.0) and the minified version of JQGrid. When i try to hide or show columns, it only works with the first one but there is no javascript error. The others columns don't change.

I've looked in the extended version and compared it with the minified version and i've found a problem with a "for" loop on the colmodel which breaks after the first element.

The loop is in grid.setcolumns.js on line 76 (on extended version of course):

for(i=0;i<$t.p.colModel.length;i++){
     if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
         var nm = $t.p.colModel[i].name.replace(/\./g, "\\.");
         if($("#col_" + nm,"#"+dtbl).attr("checked")) {
             $($t).jqGrid("showCol",$t.p.colModel[i].name);
             $("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG
         } else {
              $($t).jqGrid("hideCol",$t.p.colModel[i].name);
              $("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG
         }
    }

}

I thought it was a variable name collision problem and i've tried to change the "i" variable with "cpti" in the minified version and everything works normaly.

I hope you will understand my poor englishWink.

Thanks again

for(i=0;i<$t.p.colModel.length;i++){
                            if(!$t.p.colModel[i].hidedlg) { // added from T. Tomov
                                var nm = $t.p.colModel[i].name.replace(/\./g, "\\.");
                                if($("#col_" + nm,"#"+dtbl).attr("checked")) {
                                    $($t).jqGrid("showCol",$t.p.colModel[i].name);
                                    $("#col_" + nm,"#"+dtbl).attr("defaultChecked",true); // Added from T. Tomov IE BUG
                                } else {
                                    $($t).jqGrid("hideCol",$t.p.colModel[i].name);
                                    $("#col_" + nm,"#"+dtbl).attr("defaultChecked",""); // Added from T. Tomov IE BUG
                                }
                            }
                        }
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
28 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information