[英]Send DevExterme LoadOptions to aspnetzero
As mentioned in following document如以下文件所述
Developing-Step-By-Step-Angular-DevExtreme-Using-GetPeople-Method-from-Angular 开发-逐步-Angular-DevExtreme-Using-GetPeople-Method-from-Angular
this.dataSource = new CustomStore({
key: "id",
load: (loadOptions) => {
return this._personService.getPeople("").toPromise();
}
});
the getPeople("") has no parameter. getPeople("") 没有参数。 when I change it to getPeople(loadOptions) then I get null reference in DataSourceLoadOptions in Back-End.
当我将其更改为 getPeople(loadOptions) 时,我在后端的 DataSourceLoadOptions 中获得 null 参考。 While testing I just ignored the generated proxy and sent it by http and now it works.
在测试时,我只是忽略了生成的代理并通过 http 发送它,现在它可以工作了。
Is there something that I should do?有什么我应该做的吗?
So, I am not an angular expert by any stretch.所以,无论如何,我都不是 angular 专家。 But I did find this code located here:
但我确实在这里找到了这段代码:
DevExtreme ASP.NET Zero Integration DevExtreme ASP.NET 零集成
in the Angular section, they had this code:在 Angular 部分,他们有这个代码:
this.dataSource.store = new CustomStore({
load(loadOptions: any) {
var maxResultCount = loadOptions.take || 10;
var skipCount = loadOptions.skip || 0;
var sorting = '';
if (loadOptions.sort) {
sorting = loadOptions.sort[0].selector;
if (loadOptions.sort[0].desc) {
sorting += ' desc';
} else {
sorting += ' asc';
}
}
return self._auditLogService.getAuditLogs(
self.startDate,
self.endDate,
self.username,
self.serviceName,
self.methodName,
.......... …………
Maybe this would help.也许这会有所帮助。
Good luck.祝你好运。 Let us know how you resolved it!
让我们知道您是如何解决的!
--Dave ——戴夫
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.