jquery - 滚动出现在 JqGrid 列的标题中

标签 jquery jqgrid

这是我的JqGrid Ajax 函数:

function GetData() {
    $.ajax({
        type: "POST",
        url: "../Downloads.aspx/GetDownLoadData",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        //async: false,
        success: function (response) {
            debugger;
            var item = response.d;
            if (item != null && item != "" && typeof (item) != 'undefined') {

                $("#list").jqGrid({
                    data: JSON.parse(item),
                    datatype: 'local',
                    colNames: ['DownLoad Name', 'Format','Size','Link',''],
                    colModel: [
                    { name: 'DownLoadName', index: 'DownLoadName', width: 200, align: 'left', stype: 'text', editable: false },
                    { name: 'Format', index: 'Format', width: 150, align: 'left', stype: 'text', editable: false },
                    { name: 'Size', index: 'Size', width: 150, align: 'left', stype: 'text', editable: false },
                    { name: 'Link', index: 'Link', width: 150, align: 'left', stype: 'text', editable: false },
                    { name: 'Id', index: 'Id', width: 145, align: 'left', stype: 'text', editable: false,hidden:true }
                    ],
                    rowNum: 5,
                    height:'auto',
                    altRows: true,
                    hoverrows:true,
                    rowList: [5, 10, 20],
                    pager: '#pager',
                    sortname: 'Id',
                    sortorder: 'asc',
                    caption: "DownLoad Data",
                    viewrecords: true,
                    loadonce: true,
                    gridview: true,
                    width:995,
                       loadError: function (xhr) {
                        alert("The Status code:" + xhr.status + " Message:" + xhr.statusText);//Getting reponse 200 ok
                    }
                });
            }
            else {
                var result = '<tr align="left"><td>' + "No Record" + '</td></tr>';
                $('#list').empty().append(result);
            }
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            alert("error");
        }
    });
}

它给了我完美的输出,但是在输出中,为什么滚动条出现在列标题中?我无法弄清楚。请帮助我。谢谢。 这是输出: enter image description here

请参阅链接列中所附图片和圆圈。

最佳答案

我建议您使用以下附加 CSS 规则来解决该问题:

.ui-jqgrid-hdiv { overflow-y: hidden; }

.ui-jqgrid .ui-jqgrid-hdiv { overflow-y: hidden; }

jqGrid 仅在 .ui-jqgrid-hdiv 上设置 overflow-x:hidden; (请参阅 here )。因此,取决于所使用的其他 CSS 规则,可能会包含垂直滚动条。上面的 CSS 角色将其删除。

关于jquery - 滚动出现在 JqGrid 列的标题中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26083737/

相关文章:

javascript - 复选框检查速度慢

javascript - 是否可以在 jqGrid 标题行下显示总计(摘要)行?

javascript - 在加载外部脚本之前不要执行其余代码

jquery - 层次结构请求错误: DOM Exception 3 when trying to insertbefore

javascript - 附加表的位置不完全显示它在哪里

html - jqGrid 表格宽度小于 jqGrid 主体

java - 从 Jackson 解析器生成 JSON

javascript - 在字符串中的单词之前传递不间断空格

javascript - javascript + jquery 中的日期比较

asp.net-mvc - 如何使用 jqgrid 和 http 方法 POST 将额外的参数传递给服务器?