browse other examples

Append and prepend demo

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 and stored on the server side. For this purpose a special Server factory was implemented to emulate the remote. Three public methods are supported by this Server factory:

The initial data set consists of 50 items and can be extended unlimitedly.

Then we have adapter.append() and adapter.prepend() methods to provide an injection of just created item to the viewport. Note that in this demo 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. This is very important to build proper UI. Learn sources!