OData and CollectionView

The ICollectionView interface works great with OData sources, providing a standard way to specify filtering, sorting, and paging on the server or on the client.

This sample shows how you can populate a CollectionView object directly from OData sources and then use currency management to implement a simple master-detail view. Click a category in the first table, and the bottom table updates to show products from the selected category.

Categories

ID Name Description
{{item.CategoryID}} {{item.CategoryName}} {{item.Description}}


{{ctx.categories.currentItem.CategoryName}} ({{ctx.products.items.length}} items)

ID Name Quantity Per Unit Unit Price Units In Stock Discontinued
{{item.ProductID}} {{item.ProductName}} {{item.QuantityPerUnit}} {{item.UnitPrice | number:2}} {{item.UnitsInStock | number:0}} {{item.Discontinued}}