我已经使用pageable编写了用于分页的Java代码,并且我将ngx-swimlane datatable作为前端,在其中我尝试从服务器端实现分页。 当我尝试选择页面时,它将设置页面方法,然后点击服务,从API获取页面详细信息,并有一个正确的响应帖子,当我尝试将响应设置为数据表时,出现var.slice错误错误。我不知道如何将json设置为我的数据表行。请帮助
我的Angular组件代码:
setPage(pageInfo){
this.page.pageNumber = pageInfo.offset;
this.Service.getAllListbyPage(this.page).subscribe((data: any) => {
this.rows = data.json();
});
}
我的JSON / Response正文如下所示:
{content: Array(20), last: false, totalPages: 15, totalElements: 293, size: 20, …}
content
:
Array(20)
0
:
{id: 768, remp_id: "1", orgid: null, vertical: "Biologics ", function: "R&D", …}
1
:
{id: 634, remp_id: "1", orgid: null, vertical: "Chemical(API) ", function: "Corporate", …}
2
:
{id: 612, remp_id: "1", orgid: null, vertical: "Formulation ", function: "Corporate", …}
3
:
{id: 581, remp_id: null, orgid: null, vertical: "Formulation ", function: "Operations", …}
4
:
{id: 611, remp_id: "1", orgid: null, vertical: "Formulation ", function: "Corporate", …}
5
:
{id: 610, remp_id: "1", orgid: null, vertical: "Formulation ", function: "Corporate", …}
6
:
{id: 844, remp_id: "1", orgid: null, vertical: "Formulation ", function: "Quality", …}
7
:
{id: 691, remp_id: "1", orgid: null, vertical: "Animal Health ", function: "Operations", …}
8
:
{id: 587, remp_id: "1", orgid: null, vertical: "Formulation ", function: "R&D", …}
9
:
{id: 667, remp_id: "1", orgid: null, vertical: "CRAMS ", function: "Quality", …}
10
:
{id: 845, remp_id: "1", orgid: null, vertical: "Formulation ", function: "Quality", …}
11
:
{id: 833, remp_id: "1", orgid: null, vertical: "Formulation ", function: "Operations", …}
12
:
{id: 765, remp_id: "1", orgid: null, vertical: "Biologics ", function: "Operations", …}
13
:
{id: 717, remp_id: "1", orgid: null, vertical: "Animal Health ", function: "Corporate", …}
14
:
{id: 586, remp_id: "1", orgid: null, vertical: "Formulation ", function: "R&D", …}
15
:
{id: 809, remp_id: "1", orgid: null, vertical: "Formulation ", function: "Quality", …}
16
:
{id: 644, remp_id: "1", orgid: null, vertical: "Chemical(API) ", function: "Corporate", …}
17
:
{id: 652, remp_id: "1", orgid: null, vertical: "CRAMS ", function: "Operations", …}
18
:
{id: 654, remp_id: "1", orgid: null, vertical: "CRAMS ", function: "Operations", …}
19
:
{id: 590, remp_id: "1", orgid: null, vertical: "Formulation ", function: "Quality", …}
length
:
20
__proto__
:
Array(0)
first
:
true
last
:
false
number
:
0
numberOfElements
:
20
size
:
20
sort
:
null
totalElements
:
293
totalPages
:
15