我正在基于AJAX创建我的表,它工作正常,但是现在我想添加一个名为“ Operations”的列,并在其中放置“ edit”,“ delete”之类的按钮。
我该怎么做?我以某种方式无法在文档中找到答案,也许我遗漏了一个词或其他内容:)
[确定,找到答案,如果有人感兴趣:
我们添加带有'formatter'的列,如下所示:
{ title:"Operations", field:"", formatter:operations }
然后例如:
function operations(cell, formatterParams, onRendered){
return `
<i class="fa fa-times" title = 'Delete' data-id = ${ cell.id}></i>
`;
}