具有模态 Angular 8 的 ngx-datatable
ngx-datatable with modal Angular 8
我正在使用 ngx-tadatable,当我单击只是列索引的第一行时,它会打开模式,就好像我正在单击带有数据的漂亮行一样。有谁知道我怎样才能停止这种模式,让它只在符合数据的情况下打开。由于此模式只有在我点击数据线获取时才会打开
遵循代码。
macroarea.modal.html
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5>{{ title }}</h5>
</div>
<div class="card-body custom-datatable">
<ngx-datatable class="bootstrap pointer" [rows]="macroarea" [loadingIndicator]="loadingIndicator"
[columns]="columns" [columnMode]="'force'" [headerHeight]="40"
[summaryPosition]="'bottom'" [footerHeight]="40" [rowHeight]="'auto'"
[reorderable]="reorderable" [limit]="10" (click)="open(mymodal, $event)"
(activate)="onLoadMacroaresDatas($event)">
</ngx-datatable>
</div>
</div>
</div>
</div>
文件macroarea.component.ts
open(content, event) {
this.modalService.open(content, this.modalOptions).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
this.macroName = null;
this.modalReference = result;
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
我想你想要的是一个单一的 selection。看看这个:
http://swimlane.github.io/ngx-datatable/#single-selection
并使用select事件代替点击事件(因为点击是在整个table级别)。
我正在使用 ngx-tadatable,当我单击只是列索引的第一行时,它会打开模式,就好像我正在单击带有数据的漂亮行一样。有谁知道我怎样才能停止这种模式,让它只在符合数据的情况下打开。由于此模式只有在我点击数据线获取时才会打开 遵循代码。
macroarea.modal.html
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5>{{ title }}</h5>
</div>
<div class="card-body custom-datatable">
<ngx-datatable class="bootstrap pointer" [rows]="macroarea" [loadingIndicator]="loadingIndicator"
[columns]="columns" [columnMode]="'force'" [headerHeight]="40"
[summaryPosition]="'bottom'" [footerHeight]="40" [rowHeight]="'auto'"
[reorderable]="reorderable" [limit]="10" (click)="open(mymodal, $event)"
(activate)="onLoadMacroaresDatas($event)">
</ngx-datatable>
</div>
</div>
</div>
</div>
文件macroarea.component.ts
open(content, event) {
this.modalService.open(content, this.modalOptions).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
this.macroName = null;
this.modalReference = result;
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
我想你想要的是一个单一的 selection。看看这个:
http://swimlane.github.io/ngx-datatable/#single-selection
并使用select事件代替点击事件(因为点击是在整个table级别)。