-
Notifications
You must be signed in to change notification settings - Fork 87
Methods API
Vito Chen edited this page Jun 15, 2017
·
3 revisions
Name | Params | Types | Description |
---|---|---|---|
scrollToIndex(option) | {x: 0; y: 0; animated: true} | object | Manaually scroll the listview to a specified position |
scrollToEnd(option) | {animated: true} | object | Manually scroll the listview to the end |
getPage() | - | - | Get page |
setPage(page) | page | number | Set page |
getRows() | - | - | Get the current DataSource |
setRows(rows) | rows | array | Set the current DataSource |
refresh() | - | - | Refresh the whole list. By default, it will set the page to 1 and fetch data from server again |
updateDataSource(rows) | rows | array, object | If you want to modify or update your DataSource, you can generate a new array and pass it into this method. Then the ListView will be rerender automatically. |
onFetch(page, startFetch, abortFetch) | page, startFetch, abortFetch | number, func, func | You should call the startFetch(rowData, pageLimit) for every server request, and call the abortFetch if the network request encounter an error, like no network connection or request timeout. |