javascript - 当用户单击链接时显示模式弹出窗口 jqgrid

标签 javascript jquery jqgrid

    {
        name: 'EmployeeInformation',
        index: 'EmployeeInformation',
        width: 15,
        sortable: true,
        editable: false,
        formatter: 'showlink',
        formatoptions: {
            //show an modal popup
        }
    }

这是我的 jqgrid 中的一个表格列。

我想要的是,当我单击链接按钮(EmployeeInformation)时,它将显示一个模式弹出窗口。

最佳答案

最简单的方法是使用 formatter: 'dynamicLink'而不是formatter: 'showlink'我在 the answer 中介绍过。它允许您定义 onClick回调 ( formatoptions: {onClick: function (rowid, iRow, iCol, cellText, e) {alert('clicked in rowId=' + rowId + ', iRow=' + iRow + ', iCol=' + iCol);}} ) 就像 the demo 中那样。请参阅here也是。

另一种方法是定义 <span>text-decoration: underline; cursor: pointer;样式而不是 <a>并使用beforeSelectRowonCellSelect检测列中的单击以显示相应的模式弹出窗口。请参阅the answer , this one , this one以及其他相应的代码示例。

关于javascript - 当用户单击链接时显示模式弹出窗口 jqgrid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26008980/

相关文章:

javascript - 如何通过 AJAX 调用从 PHP MySQL 数据获取 Highstock 中的数据

javascript - WebGL:如何绑定(bind)采样器数组

jqgrid - 如何在jqgrid中使用serializeRowData选项和editRow方法将json数据发布到服务器

javascript - jqGrid - 将类分配给导航按钮

jquery - 如果 jqgrid 中没有数据,我的 Jqgrid 寻呼机显示 1 of 0

javascript - 如何在 EJS View 中使用 moment js,但获取用户本地时间而不是服务器?

javascript - 尝试访问 BigQuery 的 Oauth 客户端无效

jQuery 提取 ul 树的一部分

javascript - 具有可点击的不规则形状的网格

javascript - 用于停止滚动/聚焦的 url 哈希标记