1

I am using the latest jqGrid version but I cannot make the frozen column works at all. When I inspect it, I do not see the additional div with absolute position over the standard grid at all. Here is my jqGrid set up.

jQuery("#refTable").jqGrid({
            datatype: 'local',
            data: griddata,
            colNames: ['Reference Code','Full Citation','Primary Name Reference','Original Publication'],
            colModel: [                        
                       {name: 'reference.referenceCode',frozen:true},
                       {name: 'reference.fullCitation',frozen:true},
                       {name: 'primaryNameRefInd',width:180,align:'center',sortable:false,formatter:'checkbox'},
                       {name: 'originalPublicationInd',align:'center',sortable:false,formatter:'checkbox'}
                       ],
            //autoWidth:true,
            viewrecords:true,
            loadonce:true,
            gridview:true,
            ignorecase:true,
            height:'auto',    
            width:300,
            rowNum:5,               
            pager:'#refNav',
            sortable:true,
            sortname:'reference.referenceCode',
            //ExpandColumn:'reference.fullCitation',
            shrinkToFit:false,      
            forceFit:false,
            multiselect: false                  
        });             
        $("#refTable").parents('div.ui-jqgrid-bdiv').css("max-height","200px");
        jQuery("#refTable").jqGrid('navGrid','#refNav',{search:false,refresh:false});   

Thanks.

TrangNS
  • 11
  • 1
  • 2
  • 2
    You current code don't contain any call of `setFrozenColumns`. Look at the demos from [the answer](http://stackoverflow.com/a/8620574/315935) as examples. Additionally I don't recommend you to use `name` having points (`.`) or any other [meta-character](http://api.jquery.com/category/selectors/#jq-primaryContent). – Oleg Feb 27 '12 at 22:46
  • Thanks Oleg. I called setFrozenColumns but nothing changes. By the way, the dot (.) in name is not part of the property name, but is used to access the property of the sub object. – TrangNS Feb 28 '12 at 19:28
  • You use `colModel: [{name: 'reference.referenceCode',frozen:true},...]`. Also the `name` property of the first column is `'reference.referenceCode'`. So it do contains the dot character. You should edit the text of the question and include `griddata` which you use and the more full your current code (the call of `setFrozenColumns` for example). You should include the information enough to reproduce the problem. By the way, do you called `_complete` after the `setFrozenColumns` like I described in the referenced above [answer](http://stackoverflow.com/a/8620574/315935)? – Oleg Feb 28 '12 at 19:36
  • I figured it out. The problem is with sortable option. If I take that out, it works fine. Also, I got js error on this line of code $grid[0].p._complete.call($grid[0]); if I have a hidden column as the first column. Anyway, it's no big deal to move the hidden column to the last. – TrangNS Feb 28 '12 at 20:43
  • Of course you should hold [the documented limitations](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:frozencolumns#limitations). If you are not sure you should use `$.isFunction` before the call: `if ($.isFunction($grid[0].p._complete)) {$grid[0].p._complete.call($grid[0]);}`. – Oleg Feb 28 '12 at 20:51

0 Answers0