我正在应用程序之一中使用角度数据表,并且在其中一种情况下我想跳转到表中的特定页面。
你能帮我吗?
代码详细信息:
user.ts and user .html
user.ts
//defined dt option as any
dtOptions: any = {};
NgOnint(){
this.dtOptions = {
pagingType:'simple_numbers',
language: {
search: '',
searchPlaceholder: 'Search',
lengthMenu: 'Show _MENU_ Entries',
paginate: {
next: '❯',
previous: '❮'
}
},
pageLength:5,
paging :true,
lengthChange: true,
lengthMenu: [5, 10, 25, 50, 75, 100],
]
user.html
<table id="datatable"
datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="table table-border table-hover">
<thead>
<tr class="TableHeader">
<th class="TableHeaderth" #subId id="subId">USERID</th>
<th class="TableHeaderth">USERGROUP</th>
<th class="TableHeaderth">USER FIRST NAME</th>
<th class="TableHeaderth">USER MIDDLE NAME</th>
<th class="TableHeaderth">USER LAST NAME</th>
<th class="TableHeaderth">USER FULL NAME</th>
<th class="TableHeaderth">USER TYPE</th>
</tr>
</thead>
<tbody class="tbody">
<tr *ngFor="let person of persons;let i = index">
<td class="tabletdclientid">{{person.subscriberId}}</td>
<td class="tabletdclientname">{{person.subscriberName}}</td>
<td class="tabletdshrtname" id="alignshrtname"><span class={{person.Priority}}>{{person.client.clientName}}</span></td>
<td class="tabletd">{{person.subscriberDesc}}</td>
<td class="tabletdclientid">{{person.subscriberRemarks}}</td>
<td class="tabletd">{{person.subscriberAuthAttribute}}</td>
<td class="tabletd">{{person.subscriberIsActive}}</td>
</tr>
</t body>
</table>
我有一个按钮,然后单击按钮,将调用Test()方法,并且数据表记录应跳至特定页面。
<button (click)="test()"></button>
能否让我知道如何跳转到特定页面?