More Samples
Download Wijmo

Loading Data

Loading data into a CollectionView is straightforward.

Loading from the Server

If the data is on a server, you can retrieve it using the httpRequest method. When you get the response from the server, set the sourceCollection array to the response value or append the new data to the sourceCollection array:

If your data service API supports commands such as filtering, sorting, and paging, you can add parameters to your httpRequest calls to support those. You can even encapsulate the server API into a custom class that extends CollectionView.

For a simple example of a custom server-based CollectionView class, see our ServerCollectionView sample.

For more complete examples, with full support for CRUD operations, see the Breeze and FireBase samples or check out the source code for the ODataCollectionView class.