gpt4 book ai didi

angular - 数据表问题 - ERROR TypeError : val. slice is not a function

转载 作者:太空狗 更新时间:2023-10-29 17:37:59 24 4
gpt4 key购买 nike

错误类型错误:

val.slice is not a function

数据表配置

$.p-dataTable #dt [value]="customers" [(selection)]="chkBoxSelect" 
dataKey="customerId" [rows]="10" [paginator]="true"
paginatorPosition="both" [pageLinks]="5" [rowsPerPageOptions]="[5,10,20]"
[globalFilter]="gb" [headerCheckboxToggleAllPages]="false"
[editable]="true" exportFilename="customers" [lazy]="true"
[totalRecords]="totalRecords" onLazyLoad)="loadCustomersByPage($event)"

回调函数

$loadCustomersByPage(event: LazyLoadEvent) {

const parameters = "?page=" + event.first + "&size=" + (event.first + event.rows);

this._cs.findAllActiveCustomerDetailsByPage(parameters).subscribe(
(data: any) => {
this.customers = data;
},
(error) => {
console.log("--error--" + error)
}
);
}

最佳答案

看起来数据格式不正确..

这是分配给表的数据对象的样子:

let cars = [
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff"},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345"},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr"},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh"},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34"},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj"},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr"},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34"},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5"},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s"}
]

关于angular - 数据表问题 - ERROR TypeError : val. slice is not a function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45452732/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com