ng2-smart-table 使用 space 其中 "add" 按钮用于 "select columns" 按钮

ng2-smart-table use the space where "add" button is for "select columns" button

"Add" 按钮所在的位置似乎不对,另一方面,它是 "Columns selection" 按钮的好地方,它将打开一个对话框,允许用户 select 要查看哪些列,要隐藏哪些列

这是我对设置配置所做的相关代码更改:

actions: { 
          columnTitle: 'Actions',
          class: 'actions-area',
          add: true,              
        },    
        add: {
          addButtonContent: '<i class="nb-gear" title="select columns"></i>',
          createButtonContent: '<i class="nb-checkmark"></i>',
          cancelButtonContent: '<i class="nb-close"></i>',
        },

所以上面这段代码只是将图标从“+”图标替换为"gear"图标

见图

现在我希望这个按钮调用我的 on 函数,而不是调用向 table 添加一行的默认函数,因为我真正想做的与 "add" 无关功能性 我只需要资产 space 即可

这可以做到吗?

点这里https://akveo.github.io/ng2-smart-table/#/documentation

您需要将模式配置更改为外部

Then use this event to access that button

Then you add the event to the html

最后你将你的函数添加到你的 ts 中。

youFunction(){
  //your code here
}