December 2013
Intermediate to advanced
480 pages
14h 11m
English
The easiest way to create a custom data source is to derive a new class from the base VirtualizedDataSource class. For example, you can use the following code to create a new data source named MyDataSource:
var MyDataSource = WinJS.Class.derive( WinJS.UI.VirtualizedDataSource, // Constructor function () { this._adapter = new MyDataAdapter(); this._baseDataSourceConstructor(this._adapter); });
In the preceding code, two arguments are passed to the WinJS.Class.derive() method to create the new MyDataSource class: a base class (WinJS.UI.VirtualizedDataSource) and a constructor for the new class.
In the constructor for your derived VirtualizedDataSource class, ...
Read now
Unlock full access