在ag-Grid社区版中实现Master-Detail组件可以通过以下步骤完成:
<ag-grid-angular
style="width: 100%; height: 500px;"
class="ag-theme-alpine"
[rowData]="rowData"
[columnDefs]="columnDefs"
[frameworkComponents]="frameworkComponents"
></ag-grid-angular>
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
import { Component } from '@angular/core';
@Component({
selector: 'app-master-detail-renderer',
template: `
<div>
<button (click)="toggleDetail()">Toggle Detail</button>
<div *ngIf="showDetail">
<!-- Detail组件的内容 -->
</div>
</div>
`,
})
export class MasterDetailRendererComponent {
showDetail = false;
toggleDetail() {
this.showDetail = !this.showDetail;
}
}
领取专属 10元无门槛券
手把手带您无忧上云