简体   繁体   English

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

[英]showing a modal popup when a user clicks on a link jqgrid

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

This is a table column in my jqgrid. 这是我的jqgrid中的一个表列。

What I want is when i click the link button (EmployeeInformation) it will show a modal popup. 我想要的是当我单击链接按钮(EmployeeInformation)时将显示模式弹出窗口。

The simplest way will be to use formatter: 'dynamicLink' instead of formatter: 'showlink' which I introduced in the answer . 最简单的方法是使用formatter: 'dynamicLink' formatter: 'showlink'而不是我在答案中介绍的formatter: 'showlink' It allows you to define onClick callback ( formatoptions: {onClick: function (rowid, iRow, iCol, cellText, e) {alert('clicked in rowId=' + rowId + ', iRow=' + iRow + ', iCol=' + iCol);}} ) like in the demo . 它允许您定义onClick回调( formatoptions: {onClick: function (rowid, iRow, iCol, cellText, e) {alert('clicked in rowId=' + rowId + ', iRow=' + iRow + ', iCol=' + iCol);}} )就像在演示中一样 See here too. 也看到这里

One more way will be to define just <span> with text-decoration: underline; cursor: pointer; 另一种方法是使用text-decoration: underline; cursor: pointer;仅定义<span> text-decoration: underline; cursor: pointer; text-decoration: underline; cursor: pointer; style instead of <a> and to use beforeSelectRow or onCellSelect to detect the click in the column to show the corresponding modal popup. 风格,而不是<a>和使用beforeSelectRowonCellSelect检测点击栏,显示相应的模式弹出。 See the answer , this one , this one and other for the corresponding code examples. 有关相应的代码示例,请参见答案和其他。

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

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