You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If data is provided as a function, it must return a Promise
exportconstdataSource=functiongetData({
pageIndex, pageSize
}){returnnewPromise((resolve)=>{constrequest=newXMLHttpRequest();constconfig={method: 'GET',route: 'http://react-redux-grid.herokuapp.com/getfakeData'};if(pageIndex){config.route=`${config.route}?pageIndex=${pageIndex}&pageSize=${pageSize}`;// eslint-disable-line max-len}request.open(config.method,config.route,true);request.addEventListener('load',(res)=>{constresponse=JSON.parse(res.target.responseText);// if you have more data than is being shown// ensure you return a total, so the pager knows// what paging actions are possibleresolve({data: response.data,total: response.total});});request.send(config.data||null);});};constgrid=<GriddataSource={dataSource}/>