ng2-smart-table-如何在不同的视图中打开记录

问题描述

我能够向表中添加自定义动作,但是我仍然不知道如何单击该自定义动作来在其他页面/模式中打开记录。如何为该记录行分配ID?如何将其传递到其他视图?

在component.html

<ng2-smart-table [settings]="settings" [source]="source" (custom)="onCustomAction($event)"></ng2-smart-table>

在component.ts中

settings = {
mode: 'external',hideSubHeader: true,actions: {
  position: 'right',add: false,edit:false,delete: false,custom: [
    { name: 'viewRecord',title: '<i class="far fa-file-alt"></i>'},],},columns: {
  firstName: {
    title: 'First Name',type: 'string',lastName: {
    title: 'Last Name',username: {
    title: 'Username',email: {
    title: 'E-mail',age: {
    title: 'Age',type: 'number',

};

onCustomAction(event): void {
   
//WHAT TO DO HERE?
   
  }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)