【问题标题】:showing a modal popup when a user clicks on a link jqgrid当用户单击链接 jqgrid 时显示模式弹出窗口
【发布时间】:2014-09-24 05:07:32
【问题描述】:
    {
        name: 'EmployeeInformation',
        index: 'EmployeeInformation',
        width: 15,
        sortable: true,
        editable: false,
        formatter: 'showlink',
        formatoptions: {
            //show an modal popup
        }
    }

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

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

【问题讨论】:

  • 代码没用,不知道你在哪个模态插件
  • 那是因为我还没有任何模态插件。你能启发我吗?齐三通?

标签: javascript jquery jqgrid


【解决方案1】:

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

另一种方法是使用text-decoration: underline; cursor: pointer; 样式而不是<a> 仅定义<span>,并使用beforeSelectRow 或onCellSelect 来检测列中的点击以显示相应的模式弹出窗口。对应代码示例见the answer、this one、this one等。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-18
    • 1970-01-01
    • 2015-06-27
    • 1970-01-01
    • 1970-01-01
    • 2010-09-22
    • 1970-01-01
    相关资源
    最近更新 更多