{
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>
并使用beforeSelectRow
或onCellSelect
检测列中的单击以显示相应的模式弹出窗口。请参阅the answer , this one , this one以及其他相应的代码示例。
关于javascript - 当用户单击链接时显示模式弹出窗口 jqgrid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26008980/