browse other examples

Adapter: append and prepend sync

This sample demonstrates an ability to append and prepend new items to the initial data set via adapter. New appended and prepended items have to be synced with the real data source. For this purpose a special Server module was implemented to emulate the remote. The Server hides all indices magic, so the front-end controller logic (ui-scroll datasource implementation) looks very simple.

Two methods are implemented on the controller's scope: prepend and append. They work with two Server methods: prependItem and appendItem. The additional point is that new items would not be appended to the viewport if the EOF (end of file) is not reached. Also new items would not be prepended to the viewport if the BOF (begin of file) is not reached.

For more complex and powerful sample you may follow this demo.