在制表符中执行ajax时,如何添加除ajax之外的列?

问题描述 投票:0回答:1

我正在基于AJAX创建我的表,它工作正常,但是现在我想添加一个名为“ Operations”的列,并在其中放置“ edit”,“ delete”之类的按钮。

我该怎么做?我以某种方式无法在文档中找到答案,也许我遗漏了一个词或其他内容:)

tabulator
1个回答
0
投票

[确定,找到答案,如果有人感兴趣:

我们添加带有'formatter'的列,如下所示:

    { title:"Operations", field:"", formatter:operations }

然后例如:

    function operations(cell, formatterParams, onRendered){ 
        return `
            <i class="fa fa-times" title = 'Delete' data-id = ${ cell.id}></i>
        `;
    }
© www.soinside.com 2019 - 2024. All rights reserved.