使用电子邮件ID自动填充数据表

时间:2019-02-28 11:34:34

标签: angular typescript angular5 angular-datatables

我登录应用程序后就立即使用https://www.npmjs.com/package/angular-datatables角度数据,搜索栏会自动填充电子邮件ID,如下图Data Table

所示

我需要每次清除它才能查看结果

  <table class="table table-hover table-striped" datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger">
    <thead>

      <tr>
    <th>Name</th>
    <th>Email</th>
    <th>Role</th>
    <th>Cloud Accounts</th>
    <th>Action</th>
      </tr>
    </thead>
    <tbody>
    <tr *ngFor="let ca of usersLists; let i = index">
      <td>{{ca.name}}</td>
      <td>{{ca.emailId}}</td>
      <td><span class="badge  badge-pill badge-primary">{{ca.roleType}}</span></td>
      <td><span class="badge badge-pill badge-primary" (click)="show(ca)">{{ca.linkedCloundAccounts}}</span></td>
      <td>
          <ng-container *ngIf=" isActionEnabled ">
        <a (click)="editUserAccount(ca)" data-toggle="modal" dat Add Usera-target="#edit-user" class="btn btn-info btn-fill btn-xs" title="Edit User"><i class="fa fa-edit"></i></a>

        <a (click)="deleteUserAccount(ca,i)" data-toggle="modal" class="btn btn-danger btn-fill btn-xs" title="Delete User"><i class="fa fa-trash-o"></i></a>
        </ng-container>
      </td>
    </tr>
    </tbody>
  </table>

这是我的打字稿代码

  @ViewChild(DataTableDirective)
  dtElement: DataTableDirective;

  dtOptions: DataTables.Settings = {};
  dtTrigger: Subject<any> = new Subject();

在应用程序执行时如何禁用自动填充功能。

1 个答案:

答案 0 :(得分:0)

这会清除搜索框:

your-project-folder>php artisan key:generate

这个不保存表选项:

this.dtOptions.oSearch = {"sSearch": ``}

或者您的浏览器只是记住您的电子邮件,检查其他浏览器...