无限滚动重置服务器,ag-grid服务器端无限滚动访问道具

我试图为自己的文档中描述来实现AG-网格服务器端行模式在这里。我试图做的是将api调用及其参数作为道具传递给网格组件。问题在于,当尝试通过this.props或通过this.state来访问道具时,它们均未定义。我的代码如下所示:

onGridReady(params) {

this.gridApi = params.api;

this.gridColumnApi = params.columnApi;

this.gridApi.showLoadingOverlay();

var dataSource = {

rowCount: null,

getRows: function(params) {

setTimeout(function() {

let serviceParams = this.props.dataServiceParams ? this.props.dataServiceParams.slice() : {};

serviceParams.pageSize = this.state.paginationPageSize; // this will be the rows returned per service call

serviceParams.index = // if there is more than 1 page for the pagesize this is the index/page to return.

serviceParams.sortAndFilters = gridUtility.combineSortAndFilters(params.sortModel, params.filterModel);

this.props.dataService(serviceParams)

.then(out => {

var rowsThisPage = out;

var lastRow = -1;

params.successCallback(rowsThisPage, lastRow);

});

params.context.componentParent.gridApi.hideOverlay();

}, 500);

}

};

params.api.setDatasource(dataSource);

};

dataService道具包含我的service /

api调用,而dataServiceParams具有该服务所需的任何参数。我正在添加其他参数来处理排序,过滤和返回所需的数据页/索引。我在这里想念什么?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值