【发布时间】:2017-11-20 07:45:07
【问题描述】:
我使用 JqGrid 构建表格,当我选择一行时,我得到 onSelectRow 操作。表格中还有一个带有按钮的列,我使用格式化程序创建。如何使 onSelectRow 事件在单击按钮时不起作用?
格式化程序:
function btnCopyZn(rowId, cellValue, rowObject)
{
return "<button onClick='clickFunctionCopyZn(" + rowId + ")' class='btn btn-xs btn-default'>"
+ '<sapn class="glyphicon glyphicon-copy"></span>'
+ "</button>";
}
函数副本:
function clickFunctionCopyZn(rowId)
{
if (rowId != null)
{
var input = document.createElement("input");
input.value = rowId;
document.body.appendChild(input);
input.select();
document.execCommand("Copy");
document.body.removeChild(input);
}
}
onSelectRow:
model.tableTreeGrid.setGridParam({
onSelectRow: function ()
{
// function
}
});
【问题讨论】:
-
分享您正确的代码,以便我们查看并帮助您
-
@KresimirPendic,问题已更新。
标签: javascript jquery jqgrid