Chapter 9. Using Server Data
XMLHttpRequest object, and you’ve seen how Atlas controls make data binding easy.
In this chapter, you’ll learn how to use Atlas to connect to databases and to bind data from these sources to page elements. This functionality lets you bind complex data as well, and you are not limited to simple, static controls like text fields. With Atlas, you can use tables and HTML lists to display data and even create your own custom data source.
In Chapter 5, you have already seen how to bind data to Atlas client controls, but back then, there was no server involved. This chapter shows how to use data from the server. There, you need to write a web service that retrieves data from the data source and returns it. You can then use the client Atlas controls and xml-script markup to display that data in HTML.
Using a ListView Control
The best way to display data in Atlas is using the
ListView control (in xml-script, the
<listView> element). This control can iterate through a list so that the user can view the result—that’s where the name of the control comes from.
<listView> xml-script element, you can define two display templates:
To specify the layout and appearance of the data ...