简体   繁体   English

从 JQGrid 获取行高度

[英]Get row hieght from JQGrid

I understand I can set the row height of a JQGrid by doing the below.我知道我可以通过执行以下操作来设置 JQGrid 的行高。

$("#list").jqGrid({

loadComplete: function() {
    var grid = $("#list"),
        ids = grid.getDataIDs();

    for (var i = 0; i < ids.length; i++) {
        grid.setRowData(ids[i], false, { height : 20 + (i * 2) });
    }
}
});

I was just wondering if there a similar method I can use to loop through the grid and “GET” the row height for each row?我只是想知道是否有类似的方法可以用来遍历网格并“获取”每行的行高?

Thanks in advance,提前致谢,

You have the id of the each row - then it is easy to loop and do你有每一行的 id - 然后很容易循环并执行

$("#list").jqGrid({
    loadComplete : function() {
        var grid = $("#list"), rowheight={},
        ids = grid.getDataIDs();

        for (var i = 0; i < ids.length; i++) {
            rowheight[ids[i]] = $("#"+ ids[i]).height();
        }
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM