在jqgrid中进行水平滚动时,未冻结的列标题不会与数据一起移动(滚动),尤其是在IE11和Chrome中



IE10中,当数据scrolled horizontally时,un-frozen column headers会滚动。IE 10没有问题,按预期工作正常

但是在IE11chrome latest version中,在jqgrid中执行horizontal scroll时,Un-Frozen columns headers不会与数据一起moving(scrolling)

我将前两列设置为 frozen to true .

法典:

        $grid.jqGrid({
                        datatype: 'local',
                        data: myData,
                        colNames: ['Column1', 'Column2', 'Column3', 'Column4', 'Column5', 'Column6',
                                    'Column7', 'Column8', 'Column9', 'Column10', 'Column11', 'Column12'],
                        colModel: [
                            { name: 'col1', index: 'col1', frozen: true }, { name: 'col2', index: 'col2', frozen: true },
                            { name: 'col3', index: 'col3' }, { name: 'col4', index: 'col4' },
                            { name: 'col5', index: 'col5' }, { name: 'col6', index: 'col6' }, { name: 'col7', index: 'col7' },
                            { name: 'col8', index: 'col8' }, { name: 'col9', index: 'col9' }, { name: 'col10', index: 'col10' },
                            { name: 'col11', index: 'col11' }, { name: 'col12', index: 'col12' } 
                          ],
                        shrinkToFit: false,
                        rowNum: 20,
                        rowList: [5, 10, 20, 50, 100],
                        pager: '#pager',
                        gridview: true,
                        ignoreCase: true,
                        rownumbers: true,
                        sortname: 'col3',
                        viewrecords: true,
                        sortorder: 'desc',
                        caption: "TEST",
                        height:'auto'
                    });
            $grid.jqGrid('setFrozenColumns');

.CSS

.ui-jqgrid .ui-jqgrid-bdiv {
        position: relative;
        margin: 0em;
        padding: 0;
        overflow: auto;
        text-align: left;
        height:650px !important;
    }

jqgridhorizontal scroll时,特别是在IE11Chrome中,Un-Frozen columns headers不会与数据一起moving(scrolling)。给我一个解决方案。谢谢。

尝试添加

$grid.triggerHandler("jqGridAfterGridComplete");

紧接着$grid.jqGrid("setFrozenColumns");.如果在调用 setFrozenColumns 之前填充 jqGrid 正文,您应该这样做。在我看来,这是jqGrid的问题(参见线程中的最后一篇文章(,应该修复,但是Tony(jqGrid的开发人员(对这个问题有另一种看法。

顺便说一句,我认为您不需要使用的CSS。相反,您应该在网格中指定width选项,以便网格具有水平滚动条。

最新更新