小编Nen*_*roz的帖子

如何限制用户在角度材料设计中最多选择 5 个选择 <mat-select multiple>

我想让用户在 中选择不超过 5 个选择<mat-select multiple>,我将如何实现这一点。

selectionChange我使用的事件,但无法反映用于阻止选择中的用户的 UI,不超过 5 个。

<mat-select [(ngModel)]="orderSearchModel.analystId" name="analyst"  (selectionChange)="onChangeAnalyst($event)" multiple>
    <mat-option (click)="clearAnalyst()">clear</mat-option>
    <mat-option *ngFor="let user of users" [value]="user.value" >{{user.name}}</mat-option>
</mat-select>
Run Code Online (Sandbox Code Playgroud)

我希望用户在我的multi-select.

typescript angular-material angular

1
推荐指数
1
解决办法
1467
查看次数

分页时jQuery事件不再被监听

我正在使用分页实现bootstrap-table,我最近注意到在使用它时,我的自定义jQuery脚本不再起作用了.

更确切地说,这是一个片段:

$(document).ready(function() {

  $('.form-modal-confirm-remove').click(function() {

    alert("Test");

  });

});
Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/locale/bootstrap-table-fr-FR.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>

<table data-toggle="table" data-classes="table table-hover table-condensed table-no-bordered" data-pagination="true" data-page-size="2">
  <thead>
    <tr>
      <th>ID</th>
      <th>Name</th>
      <th>Actions</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        1
      </td>
      <td>
        Test
      </td>
      <td>
        <button type="button" class="btn btn-danger btn-circle form-modal-confirm-remove" data-toggle="tooltip" data-placement="top" title="Supprimer">
          <i class="fa fa-trash"></i>
        </button>
      </td>
    </tr>
    <tr>
      <td>
        2
      </td>
      <td>
        Test
      </td>
      <td>
        <button type="button" class="btn btn-danger btn-circle form-modal-confirm-remove" data-toggle="tooltip" …
Run Code Online (Sandbox Code Playgroud)

jquery pagination bootstrap-table

0
推荐指数
1
解决办法
73
查看次数