|
Runtime-SparseArrays
Page history
last edited
by Charles Jolley 14 years, 4 months ago
- A SparseArray acts like an Array (in that is implements SC.Enumerable and SC.Array), but it populates with content only as needed.
- Sparse array's are used most often to implement "incremental loading", where you will present what appears to be a very large array to the rest of the application. But in reality you will only load a portion of the array data from the server when it is actually requested.
- You can use Sparse Array's anytime you have a large dataset that you want to display in the UI but it would be too expensive to setup the array contents up front.
- Using a SparseArray
- To use a sparse array, you simply need to implement a SparseArray delegate. A delegate is a third party object that is given some control over the SparseArray. It is how SproutCore allows you to implement custom control of an object without having to build a subclass.
- Your delegate will be notified anytime the array needs to load some data. You must then provide the array with this data. You can provide the data immediately or asynchronously.
Runtime-SparseArrays
|
Tip: To turn text into a link, highlight the text, then click on a page or file from the list above.
|
|
|
Comments (0)
You don't have permission to comment on this page.