List of orders for a customer (uses static JSON data)

Description

Example showing a list of orders for a customer based on static JSON data. No SQL database is required.

Discussion

This example shows how rich HTML output can be created by merging data in a JavaScript object with a Client Side Template. This example can be thought of as a client-side report writer. It would be easy to make various parts of the report 'hot' (i.e. fire events) by adding event handlers into the HTML template defined in the ViewBox.

This sample is the same as the List of orders for a customer (from the Northwind sample database) sample. The difference between the two samples is that this sample uses statically defined data in a JSON object.

images/listOfOrdersJSON1.png

The JavaScript object for the data displayed in this ViewBox is an array of customers with nested arrays of orders for each customer. Each order contains a nested array of order details. The object is merged with a Client Side Template to generate the final result.

The List of orders for a customer (uses static JSON data) template example is loaded by clicking the Load Sample ViewBox link on the Home tab of the ViewBox Builder.

images/loadListOfOrdersJSON.png

See Also