我正在研究一个项目,并在angular应用程序中绑定来自ngrx存储的devextreme数据网格。我正在调度一个动作,并根据该动作来更新我的Redux存储,即从api获取网格数据。我正在将动作分派到devextreme的customstore的load函数中。
this.gridDS.store = new CustomStore({
load: (loadOptions: any) => {
params += 'skip=' + loadOptions.skip || 0;
params += 'take=' + loadOptions.take || 15;
if (loadOptions.sort) {
params += '&orderby=' + loadOptions.sort[0].selector;
if (loadOptions.sort[0].desc) {
params += ' desc';
}
}
if (params === '?') {params = '?skip=0&take=3' }
this.ngRedux.dispatch(this.commonActions.getGrid(params));
return this.ngRedux.select(['common', 'csGridData'])
.toPromise()
.then((result: any) => {
return { data: result.data, totalCount: result.totalCount};
})
.catch(error => { });
}
});
的链接
有人可以帮我吗?
预先感谢