Chapter 7

Presenting Data

In This Chapter

arrow Getting data on the screen

arrow Using JavaScript to populate content

arrow Making use of the WinJS binding tools

arrow Grouping and sorting

At its core, Windows 8 is about giving the user access to their data in a beautiful way. Microsoft has a bunch of fancy guidelines and whatnot that I talk about in Chapters 2 and 6, but if you don’t give the user value, that beauty goes for naught.

HTML5 is less about data than it should be. There are really no good structures for data presentation in the HTML toolset other than the Table, and that is fraught with layout issues. HTML is great for getting stuff on the page, but it just doesn’t have a databinding superstructure.

WinJS has fixed that. The WinJS.Binding namespace provides a way to mark up HTML divs with data attributes in either JavaScript or HTML. You can configure single one-time bindings or group bindings for lists. It offers sophisticated sorting and grouping. It even offers special controls that take advantage of touch and the tablet form factor.

Showing Single Bits of Data

WinJS offers you two different ...

Get Windows 8 Application Development with HTML5 For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.