可以在 jqgrid 中的特定行上悬停鼠标悬停时显示子网格



>我有一个jqgrid,我需要在其中显示一个子网格,鼠标悬停在特定行上...但我不知道同样的可能性...

我正在通过 ajax 调用将 json 数据本地绑定到我的 jqgrid 中......有没有鼠标悬停在 Jqgrid rowid 上的事件......

任何从事过它或有想法的人请朝着正确的方向指导......

这是我的加载详细信息...

$(document).ready(function () {
    $("#go").click(function () {
        $("#gridId").GridUnload();
        gridload();
    });
});

提前谢谢..

人们可以用不同的方式解释你在"我需要在鼠标悬停时显示一个子网格"下的意思。我想您需要在悬停行时消耗子网格。

我修改了答案中的演示,以演示该要求的一种可能实现。您可以在此处看到的结果。该实现包括将以下代码插入回调loadComplete

loadComplete: function () {
    var $this = $(this);
    $this.find(">tbody>.jqgrow")
        .mouseenter(function (e) {
            if ($(this).find(">td.ui-sgcollapsed").length > 0) {
                $this.jqGrid("expandSubGridRow", this.id);
            }
        });
}

最新更新