2017-12-05 1 views
0

API를 사용하여 가져온 레코드를 페이지 매김하려고합니다. 페이지 매김을 추가하는 방법을 모르겠습니다. 내 코드는 다음과 같습니다.가져온 데이터를 원본 네이티브 API에서 페이징하는 방법

handlePressProduct(id) { 
    var url='http://www.example.com/menu_category_listing.php?cat_id='; 
    fetch(url+id, { 
    method: 'GET' 
    }).then((response) => { return response.json() }) 
    .then((responseJson) => { 
    console.log(responseJson);   Actions.category({dataSource:ds.cloneWithRows(responseJson),data:responseJson,})  
    }) 

     } 

Actions.category()에 대한 게시 데이터가 올바르게 있습니다. 데이터가 너무 커서로드하는 데 시간이 걸립니다. 그래서 페이지 매김을 추가해야합니다.

답변

1

서버에서 페이지 매김을 만든다면 더 좋을 것 같습니다.

관련 문제