Sunday, March 16, 2014

Rapid Business Apps Development Series – Part 1 (Visual Studio Templates)

Rapid Business Apps Development Series – Part 1 (Visual Studio Templates)

Purpose: The purpose of this series is to illustrate how to rapidly develop business applications integrated with Microsoft Dynamics AX 2012. In this document we'll focus primarily on User Interface, other documents in this series will cover Web Services and Comminication Infrastructure, and more.

Challenge: Lots of developers in the world enjoy developing Windows 8 Apps for business, as well as lots of organizations in the world enjoy using Windows 8 Apps for business. The question is how quickly *I* can develop a business app. Say one of typical Manufacturing industry workloads could be for Production Manager who wants to review the list of Production orders to be aware of what's going on while he/she is on the go (away from the desk) inside or outside of facility and potentially take some actions.    

Solution: Microsoft has a variety of Windows 8 Apps integrated with Microsoft Dynamics AX 2012 available in the Store, as well as published a detailed guidance on how to develop secure mobile apps integrated with Microsoft Dynamics AX 2012. In this document I'll look at things from partner or customer perspective who may have people familiar with HMTL5/JavaScript and web development in house, but maybe never developed Windows 8 Apps before. In this walkthrough I'll try to be one of those web and/or .NET developers who wants to develop a concept modern Windows 8 App for Production Manager described above within 1 hour or so. All I need in this particular case is a PC running Windows 8.1 and Visual Studio 2013 installed on it. In order to very quickly develop a concept modern Windows 8 App I'll leverage Visual Studio Hub template and transform it the way I need to achieve the result. Please note that in this walkthrough I'm playing a Developer role, in other documents in this series I'll explain how Business Users can also quickly create modern Windows 8 Apps using Microsoft technology.

Please note that in this document I assume that the reader has development background, some experience in web development (CSS/HTML/JavaScript) and understanding of the purpose for WinJS libarary.

Please find more info about WinJS here: http://msdn.microsoft.com/en-us/library/windows/apps/br229773.aspx       

Important: Before I begin I want to call out the fact that I will provide a lot of source code (CSS/HTML/JavaScript) in this article, however the amount of code I'll actually write by hand will be very minimal because I'll mostly be doing a template transformation. And the reason for providing a source code is solely for your convenience when comparing Before and After some changes have been introduced  

Walkthrough

 

Let's begin with conceptual design of Production Manager App

For this purpose we can use PowerPoint to define 3 main screens for Production Manager App

Overview screen with a list of Production orders

Group screen displaying Production orders for selected group with more details

Production order screen displaying details of selected Production order

 

Now since we know what we want to build, we can discuss what we will be using to do that

All I'll be given is Windows 8.1 PC and Visual Studio 2013 installed

The idea is to utilize Windows 8 Hub App standard Visual Studio 2013 template which will give me a jump start for Production Manager App development. Please note that most of the work I'll do below will be template transformation with a minimum new code written. Let's see how far we can get with standard Visual Studio Hub App template. My goal is still to do this within 1 hour

Let's get to work now

First step will be to create a Project based on Visual Studio 2013 Hub App template

Visual Studio 2013 – Hub App

Hub App template will give me a desired pages structure, navigation and more right away

Let's review what we've already got

Overview screen (All production orders)

Group screen (Group of production orders)

Item screen (Production order)

Please note that Item screen in Hub App template is empty. Item screen is also empty in Visual Studio 2013 Grid App template 

Visual Studio 2013 – Grid App

However I know that Item screen has non-empty layout in Visual Studio 2012 – Grid App template

Visual Studio 2012 – Grid App (Overview screen)

Visual Studio 2012 – Grid App (Group screen)

Visual Studio 2012 – Grid App (Item screen)

So in order to have some initial layout for Item screen I'll borrow the source code for Item screen from Visual Studio 2012 Grid App template into my Visual Studio 2013 Hub App project

All I have to do now is Copy-and-Paste contents of ItemDetail folder from Visual Studio 2012 Grid App into my project

Visual Studio 2013 Hub App

Visual Studio 2012 Grid App

 

Just for your information this is how Item page source code looks like in 2 projects

Item.css

.itempage .content {

    margin-left: 120px;

    margin-right: 120px;

}

 

Item.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>itemPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-dark.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/item/item.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/item/item.js"></script>

</head>

<body>

    <!-- The content that will be loaded and displayed. -->

    <div class="itempage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle"></span>

            </h1>

        </header>

        <section class="content" aria-label="Main content" role="main">

 

            <!-- TODO: Content goes here. -->

 

        </section>

    </div>

</body>

</html>

 

Item.js

(function () {

    "use strict";

 

    WinJS.UI.Pages.define("/pages/item/item.html", {

        // This function is called whenever a user navigates to this page. It

        // populates the page elements with the app's data.

        ready: function (element, options) {

            var item = Data.resolveItemReference(options.item);

            element.querySelector(".titlearea .pagetitle").textContent = item.title;

 

            // TODO: Initialize the page here.

        }

    });

})();

 

ItemDetail.css

.itemdetailpage .content {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

    display: block;

    height: 100%;

    overflow-x: auto;

    position: relative;

    width: 100%;

    z-index: 0;

}

 

    .itemdetailpage .content article {

        /* Define a multi-column, horizontally scrolling article by default. */

        column-fill: auto;

        column-gap: 80px;

        column-width: 480px;

        height: calc(100% - 183px);

        margin-left: 120px;

        margin-right: 120px;

        margin-top: 133px;

        width: 480px;

    }

 

        .itemdetailpage .content article header .item-title {

            margin-bottom: 19px;

        }

 

        .itemdetailpage .content article header .item-subtitle {

            margin-bottom: 16px;

            margin-top: 0;

        }

 

        .itemdetailpage .content article .item-image {

            height: 240px;

            width: 460px;

        }

 

        .itemdetailpage .content article .item-content p {

            margin-top: 10px;

            margin-bottom: 20px;

        }

 

@media screen and (-ms-view-state: snapped) {

    .itemdetailpage .content {

        -ms-grid-row: 2;

        -ms-grid-row-span: 1;

        overflow-x: hidden;

        overflow-y: auto;

    }

 

        .itemdetailpage .content article {

            /* Define a single column, vertically scrolling article in snapped mode. */

            -ms-grid-columns: 300px 1fr;

            -ms-grid-row: 2;

            -ms-grid-rows: auto 60px;

            display: -ms-grid;

            height: 100%;

            margin-left: 20px;

            margin-right: 20px;

            margin-top: 6px;

            width: 280px;

        }

 

            .itemdetailpage .content article header .item-title {

                margin-bottom: 10px;

            }

 

            .itemdetailpage .content article .item-image {

                height: 140px;

                width: 280px;

            }

 

            .itemdetailpage .content article .item-content {

                padding-bottom: 60px;

                width: 280px;

            }

}

 

@media screen and (-ms-view-state: fullscreen-portrait) {

    .itemdetailpage .content article {

        margin-left: 100px;

        margin-right: 100px;

    }

}

 

ItemDetail.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>itemDetailPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.1.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.1.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/itemDetail/itemDetail.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/itemDetail/itemDetail.js"></script>

</head>

<body>

    <!-- The content that will be loaded and displayed. -->

    <div class="itemdetailpage fragment">

        <header aria-label="Header content" role="banner">

            <button class="win-backbutton" aria-label="Back" disabled type="button"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle"></span>

            </h1>

        </header>

        <div class="content" aria-label="Main content" role="main">

            <article>

                <div>

                   <header>

                        <h2 class="item-title"></h2>

                        <h4 class="item-subtitle"></h4>

                    </header>

                    <img class="item-image" src="#" />

                    <div class="item-content"></div>

                </div>

            </article>

        </div>

    </div>

</body>

</html>

 

ItemDetail.js

(function () {

    "use strict";

 

    WinJS.UI.Pages.define("/pages/itemDetail/itemDetail.html", {

        // This function is called whenever a user navigates to this page. It

        // populates the page elements with the app's data.

        ready: function (element, options) {

            var item = options && options.item ? Data.resolveItemReference(options.item) : Data.items.getAt(0);

            element.querySelector(".titlearea .pagetitle").textContent = item.group.title;

            element.querySelector("article .item-title").textContent = item.title;

            element.querySelector("article .item-subtitle").textContent = item.subtitle;

            element.querySelector("article .item-image").src = item.backgroundImage;

            element.querySelector("article .item-image").alt = item.subtitle;

            element.querySelector("article .item-content").innerHTML = item.content;

            element.querySelector(".content").focus();

        }

    });

})();

 

After I copy the source code for Item page from Visual Studio 2012 Grid App into my project I'll have to correct the code appropriately

In particular I'll simply replace (Ctrl+H) "itemdetailpage" with "itempage" in Item.css

Item.css

.itempage .content {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

    display: block;

    height: 100%;

    overflow-x: auto;

    position: relative;

    width: 100%;

    z-index: 0;

}

 

    .itempage .content article {

        /* Define a multi-column, horizontally scrolling article by default. */

        column-fill: auto;

        column-gap: 80px;

        column-width: 480px;

        height: calc(100% - 183px);

        margin-left: 120px;

        margin-right: 120px;

        margin-top: 133px;

        width: 480px;

    }

 

        .itempage .content article header .item-title {

            margin-bottom: 19px;

        }

 

        .itempage .content article header .item-subtitle {

            margin-bottom: 16px;

            margin-top: 0;

        }

 

        .itempage .content article .item-image {

            height: 240px;

            width: 460px;

        }

 

        .itempage .content article .item-content p {

            margin-top: 10px;

            margin-bottom: 20px;

        }

 

@media screen and (-ms-view-state: snapped) {

    .itempage .content {

        -ms-grid-row: 2;

        -ms-grid-row-span: 1;

        overflow-x: hidden;

        overflow-y: auto;

    }

 

        .itempage .content article {

            /* Define a single column, vertically scrolling article in snapped mode. */

            -ms-grid-columns: 300px 1fr;

            -ms-grid-row: 2;

            -ms-grid-rows: auto 60px;

            display: -ms-grid;

            height: 100%;

            margin-left: 20px;

            margin-right: 20px;

            margin-top: 6px;

            width: 280px;

        }

 

            .itempage .content article header .item-title {

                margin-bottom: 10px;

            }

 

            .itempage .content article .item-image {

                height: 140px;

                width: 280px;

            }

 

            .itempage .content article .item-content {

                padding-bottom: 60px;

                width: 280px;

            }

}

 

@media screen and (-ms-view-state: fullscreen-portrait) {

    .itempage .content article {

        margin-left: 100px;

        margin-right: 100px;

    }

}

 

Also I will merge code (copy-and-paste) into Item.html and add <article> tag as shown below

Item.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>itemPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-dark.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/item/item.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/item/item.js"></script>

</head>

<body>

    <!-- The content that will be loaded and displayed. -->

    <div class="itempage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle"></span>

            </h1>

        </header>

        <section class="content" aria-label="Main content" role="main">

            <article>

                <div>

                    <header>

                        <h2 class="item-title"></h2>

                        <h4 class="item-subtitle"></h4>

                    </header>

                    <img class="item-image" src="#" />

                    <div class="item-content"></div>

                </div>

            </article>

        </section>

    </div>

</body>

</html>

 

Similarly I will merge code (copy-and-paste) in Item.js

Item.js

(function () {

    "use strict";

 

    WinJS.UI.Pages.define("/pages/item/item.html", {

        // This function is called whenever a user navigates to this page. It

        // populates the page elements with the app's data.

        ready: function (element, options) {

            var item = Data.resolveItemReference(options.item);

            element.querySelector(".titlearea .pagetitle").textContent = item.title;

            element.querySelector("article .item-title").textContent = item.title;

            element.querySelector("article .item-subtitle").textContent = item.subtitle;

            element.querySelector("article .item-image").src = item.backgroundImage;

            element.querySelector("article .item-image").alt = item.subtitle;

            element.querySelector("article .item-content").innerHTML = item.content;

            element.querySelector(".content").focus();

        }

    });

})();

 

The next step will be to change the title of our app

In order to do that I will modify default.html, hub.html and package.appxmanifest replacing (Ctrl+H) "App1" with "Manufacturing Companion"

Now our Overview screen will look like this

Next I'd like to change a color schema

In order to do that I'll modify default.html, hub.html, item.html and section.html replacing "ui-dark.css" to "ui-light.css"

Now we got a light color schema which looks better to me

Next I'll make our app look friendlier and more professional by adding a background image

Here's the image I want to use for my Production Manager App

Please note that I purchased rights to use this background image from one of digital images providers. Then I put the file into images folder

And add it to the project

Now all I need to do is to replace "background-image: url" property in Hub.css

Hub.css (Before)

.hubpage .hub .hero {

    -ms-high-contrast-adjust: none;

    background-image: url(/images/gray.png);

    background-size: cover;

    margin-left: -80px;

    margin-right: 80px;

    padding: 0;

    width: 780px;

}

 

Hub.css (After)

.hubpage .hub .hero {

    -ms-high-contrast-adjust: none;

    background-image: url(/images/gears.jpg);

    background-size: cover;

    margin-left: -80px;

    margin-right: 80px;

    padding: 0;

    width: 780px;

}

 

Now our app looks even better

Please note that our Overview screen currently looks busy and truly all we need for our app is Section 3. That's why on the next step we're going to simply our template

Let's dive into the code more!

In order to simplify Hub page I will simply comment out unwanted Sections 1, 2 and 4

Hub.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>hubPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/hub/hub.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/hub/hub.js"></script>

</head>

<body>

    <div class="hubpage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle">Manufacturing Companion</span>

            </h1>

        </header>

 

        <section aria-label="Main content" role="main">

            <!-- Customize the Hub control by modifying the HubSection controls here. -->

 

            <div class="hub" data-win-control="WinJS.UI.Hub">

                <div class="hero" data-win-control="WinJS.UI.HubSection">

                </div>

 

                <!--

                <div class="section1" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section1'} }">

                    <img src="/images/gray.png" width="420" height="280" />

                    <div class="subtext win-type-x-large" data-win-res="{ textContent: 'Section1Subtext' }"></div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                    </div>

                </div>

 

                <div class="section2" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section2'} }">

                    <div class="item-title win-type-medium" data-win-res="{ textContent: 'Section2ItemTitle' }"></div>

                    <div class="article-header win-type-x-large" data-win-res="{ textContent: 'Section2Subtext' }"></div>

                    <div class="win-type-xx-small" data-win-res="{ textContent: 'Section2ItemSubTitle' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                    </div>

                </div>

                -->

 

                <div class="section3" data-win-control="WinJS.UI.HubSection" data-win-res="{ winControl: {'header': 'Section3'} }"

                     data-win-options="{ onheaderinvoked: select('.pagecontrol').winControl.section3HeaderNavigate }">

                    <div class="itemTemplate" data-win-control="WinJS.Binding.Template">

                        <img src="#" data-win-bind="src: backgroundImage; alt: title" />

                        <div class="win-type-medium" data-win-bind="textContent: title"></div>

                        <div class="win-type-small" data-win-bind="textContent: description"></div>

                    </div>

                    <div class="itemslist win-selectionstylefilled" data-win-control="WinJS.UI.ListView" data-win-options="{

                        layout: {type: WinJS.UI.GridLayout},

                        selectionMode: 'none',

                        itemTemplate: select('.section3 .itemTemplate'),

                        itemDataSource: select('.pagecontrol').winControl.section3DataSource,

                        oniteminvoked: select('.pagecontrol').winControl.section3ItemNavigate

                    }">

                    </div>

                </div>

 

                <!--

                <div class="section4" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section4'} }">

                    <div class="top-image-row">

                        <img src="/images/gray.png" />

                    </div>

                    <div class="sub-image-row">

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                    </div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                    </div>

                </div>

                -->

            </div>

        </section>

    </div>

</body>

</html>

Now it looks like this is what we need

Now it is time to simplify Section page

In order to do that I'll also comment out appropriate code in HTML and get rid of "headerTemplate" and "groupDataSource"

Section.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>sectionPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/section/section.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/section/section.js"></script>

</head>

<body>

    <!-- These templates are used to display each item in the ListView declared below. -->

    <!--

    <div class="headertemplate" data-win-control="WinJS.Binding.Template">

        <h2 class="group-subtitle" data-win-res="{ 'innerHTML': 'SectionSubtitle' }"></h2>

        <img class="group-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

        <h4 class="group-description" data-win-bind="innerHTML: description"></h4>

    </div>

    -->

    <div class="itemtemplate" data-win-control="WinJS.Binding.Template">

        <div class="item">

            <img class="item-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

            <div class="item-info">

                <h4 class="item-title" data-win-bind="textContent: title"></h4>

                <h6 class="win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>

                <h4 class="item-description" data-win-bind="textContent: description"></h4>

            </div>

        </div>

    </div>

 

    <!-- The content that will be loaded and displayed. -->

    <div class="sectionpage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle"></span>

            </h1>

        </header>

        <section aria-label="Main content" role="main">

            <div class="itemslist win-selectionstylefilled" aria-label="List of this section's items" data-win-control="WinJS.UI.ListView" data-win-options="{

                    selectionMode: 'none',

                    layout: {type: WinJS.UI.GridLayout, groupHeaderPosition: 'left'},

                    currentItem: {type: WinJS.UI.ObjectType.item, index: 0, hasFocus: true},                   

                    itemDataSource: select('.pagecontrol').winControl.itemDataSource,

                    itemTemplate: select('.itemtemplate'),

                    oniteminvoked: select('.pagecontrol').winControl.itemInvoked

                }">

                <!--

                    groupDataSource: select('.pagecontrol').winControl.groupDataSource,

                    groupHeaderTemplate: select('.headertemplate'),

                -->

            </div>

        </section>

    </div>

</body>

</html>

 

 

Now I don't use "groupDataSource" so I'll also need to comment it out in JavaScript

Section.js

(function () {

    "use strict";

 

    var ui = WinJS.UI;

 

    ui.Pages.define("/pages/section/section.html", {

        /// <field type="WinJS.Binding.List" />

        _items: null,

 

        processed: function (element) {

            return WinJS.Resources.processAll(element);

        },

 

        // This function is called to initialize the page.

        init: function (element, options) {

            var group = Data.resolveGroupReference(options.groupKey);

            this._items = Data.getItemsFromGroup(group);

            var pageList = this._items.createGrouped(

                function groupKeySelector(item) { return group.key; },

                function groupDataSelector(item) { return group; }

            );

            //this.groupDataSource = pageList.groups.dataSource;

            this.itemDataSource = pageList.dataSource;

            this.itemInvoked = ui.eventHandler(this._itemInvoked.bind(this));

        },

 

        // This function is called whenever a user navigates to this page.

        ready: function (element, options) {

            element.querySelector("header[role=banner] .pagetitle").textContent = options.title;

 

            var listView = element.querySelector(".itemslist").winControl;

            listView.element.focus();

        },

 

        unload: function () {

            this._items.dispose();

        },

 

        // This function updates the page layout in response to layout changes.

        updateLayout: function (element) {

            /// <param name="element" domElement="true" />

 

            // TODO: Respond to changes in layout.

        },

 

        _itemInvoked: function (args) {

            var item = this._items.getAt(args.detail.itemIndex);

            WinJS.Navigation.navigate("/pages/item/item.html", { item: Data.getItemReference(item) });

        }

    });

})();

 

 

Now our Group screen looks like this

 

Next we'll further modify Hub page

This time we will copy and paste code from Section to Hub to make it look like we need

Let's look at how the source code looked like Before changes

Hub.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>hubPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/hub/hub.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/hub/hub.js"></script>

</head>

<body>

    <div class="hubpage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle">Manufacturing Companion</span>

            </h1>

        </header>

 

        <section aria-label="Main content" role="main">

            <!-- Customize the Hub control by modifying the HubSection controls here. -->

 

            <div class="hub" data-win-control="WinJS.UI.Hub">

                <div class="hero" data-win-control="WinJS.UI.HubSection">

                </div>

 

                <!--

                <div class="section1" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section1'} }">

                    <img src="/images/gray.png" width="420" height="280" />

                    <div class="subtext win-type-x-large" data-win-res="{ textContent: 'Section1Subtext' }"></div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                    </div>

                </div>

 

                <div class="section2" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section2'} }">

                    <div class="item-title win-type-medium" data-win-res="{ textContent: 'Section2ItemTitle' }"></div>

                    <div class="article-header win-type-x-large" data-win-res="{ textContent: 'Section2Subtext' }"></div>

                    <div class="win-type-xx-small" data-win-res="{ textContent: 'Section2ItemSubTitle' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                    </div>

                </div>

                -->

 

                <div class="section3" data-win-control="WinJS.UI.HubSection" data-win-res="{ winControl: {'header': 'Section3'} }"

                     data-win-options="{ onheaderinvoked: select('.pagecontrol').winControl.section3HeaderNavigate }">

                    <div class="itemTemplate" data-win-control="WinJS.Binding.Template">

                        <img src="#" data-win-bind="src: backgroundImage; alt: title" />

                        <div class="win-type-medium" data-win-bind="textContent: title"></div>

                        <div class="win-type-small" data-win-bind="textContent: description"></div>

                    </div>

                    <div class="itemslist win-selectionstylefilled" data-win-control="WinJS.UI.ListView" data-win-options="{

                        layout: {type: WinJS.UI.GridLayout},

                        selectionMode: 'none',

                        itemTemplate: select('.section3 .itemTemplate'),

                        itemDataSource: select('.pagecontrol').winControl.section3DataSource,

                        oniteminvoked: select('.pagecontrol').winControl.section3ItemNavigate

                    }">

                    </div>

                </div>

 

                <!--

                <div class="section4" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section4'} }">

                    <div class="top-image-row">

                        <img src="/images/gray.png" />

                    </div>

                    <div class="sub-image-row">

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                    </div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                    </div>

                </div>

                -->

            </div>

        </section>

    </div>

</body>

</html>

 

Hub.css

.hubpage header[role=banner] {

    position: relative;

    z-index: 2;

}

 

.hubpage section[role=main] {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

    z-index: 1;

}

 

.hubpage .hub .win-hub-surface {

    height: 100%;

}

 

.hubpage .hub .hero {

    -ms-high-contrast-adjust: none;

    background-image: url(/images/gears.jpg);

    background-size: cover;

    margin-left: -80px;

    margin-right: 80px;

    padding: 0;

    width: 780px;

}

 

    .hubpage .hub .hero:-ms-lang(ar, dv, fa, he, ku-Arab, pa-Arab, prs, ps, sd-Arab, syr, ug, ur, qps-plocm) {

        margin-left: 80px;

        margin-right: -80px;

    }

 

    .hubpage .hub .hero .win-hub-section-header {

        display: none;

    }

 

.hubpage .hub .section1 {

    width: 420px;

}

 

    .hubpage .hub .section1 .win-hub-section-content {

       overflow-y: hidden;

    }

 

    .hubpage .hub .section1 .subtext {

        margin-bottom: 7px;

        margin-top: 9px;

    }

 

.hubpage .hub .section2 {

    width: 440px;

}

 

    .hubpage .hub .section2 .win-hub-section-content {

        overflow-y: hidden;

    }

 

    .hubpage .hub .section2 .item-title {

        margin-top: 4px;

        margin-bottom: 10px;

    }

 

    .hubpage .hub .section2 .article-header {

        margin-bottom: 15px;

    }

 

.hubpage .hub .section3 {

}

 

    .hubpage .hub .section3 .itemslist {

        height: 100%;

        margin-left: -10px;

        margin-right: -10px;

        margin-top: -5px;

    }

 

    .hubpage .hub .section3 .win-container {

        margin-bottom: 36px;

        margin-left: 10px;

        margin-right: 10px;

    }

 

    .hubpage .hub .section3 .win-item {

        height: 229px;

        width: 310px;

    }

 

        .hubpage .hub .section3 .win-item img {

            height: 150px;

            margin-bottom: 10px;

            width: 310px;

        }

 

.hubpage .hub .section4 {

    width: 400px;

}

 

    .hubpage .hub .section4 .win-hub-section-content {

        overflow-y: hidden;

    }

 

    .hubpage .hub .section4 .top-image-row {

        height: 260px;

        margin-bottom: 10px;

        width: 400px;

    }

 

        .hubpage .hub .section4 .top-image-row img {

            height: 100%;

            width: 100%;

        }

 

    .hubpage .hub .section4 .sub-image-row {

        margin-bottom: 20px;

        display: -ms-flexbox;

        -ms-flex-flow: row nowrap;

        -ms-flex-pack: justify;

    }

 

        .hubpage .hub .section4 .sub-image-row img {

            height: 95px;

            width: 130px;

        }

 

Section.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>sectionPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/section/section.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/section/section.js"></script>

</head>

<body>

    <!-- These templates are used to display each item in the ListView declared below. -->

    <!--

    <div class="headertemplate" data-win-control="WinJS.Binding.Template">

        <h2 class="group-subtitle" data-win-res="{ 'innerHTML': 'SectionSubtitle' }"></h2>

        <img class="group-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

        <h4 class="group-description" data-win-bind="innerHTML: description"></h4>

    </div>

    -->

    <div class="itemtemplate" data-win-control="WinJS.Binding.Template">

        <div class="item">

            <img class="item-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

            <div class="item-info">

                <h4 class="item-title" data-win-bind="textContent: title"></h4>

                <h6 class="win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>

                <h4 class="item-description" data-win-bind="textContent: description"></h4>

            </div>

        </div>

    </div>

 

    <!-- The content that will be loaded and displayed. -->

    <div class="sectionpage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle"></span>

            </h1>

        </header>

        <section aria-label="Main content" role="main">

            <div class="itemslist win-selectionstylefilled" aria-label="List of this section's items" data-win-control="WinJS.UI.ListView" data-win-options="{

                    selectionMode: 'none',

                    layout: {type: WinJS.UI.GridLayout, groupHeaderPosition: 'left'},

                    currentItem: {type: WinJS.UI.ObjectType.item, index: 0, hasFocus: true},                   

                    itemDataSource: select('.pagecontrol').winControl.itemDataSource,

                    itemTemplate: select('.itemtemplate'),

                    oniteminvoked: select('.pagecontrol').winControl.itemInvoked

                }">

                <!--

                    groupDataSource: select('.pagecontrol').winControl.groupDataSource,

                    groupHeaderTemplate: select('.headertemplate'),

                -->

            </div>

        </section>

    </div>

</body>

</html>

 

Section.css

.sectionpage section[role=main] {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

}

 

.sectionpage .itemslist {

    height: 100%;

    position: relative;

    width: 100%;

    z-index: 0;

}

 

    /* This selector is used to prevent ui-dark/light.css from overwriting changes

       to .win-surface. */

    .sectionpage .itemslist .win-horizontal.win-viewport .win-surface {

        margin-bottom: 35px;

        margin-left: 50px;

        margin-right: 50px;

        margin-top: 128px;

    }

 

    .sectionpage .itemslist .win-groupheader {

        -ms-grid-columns: 1fr;

        -ms-grid-rows: auto auto 1fr;

        display: -ms-grid;

        height: 100%;

        margin-left: 0;

        margin-right: 40px;

        padding: 0;

        width: 480px;

    }

 

        .sectionpage .itemslist .win-groupheader:-ms-lang(ar, dv, fa, he, ku-Arab, pa-Arab, prs, ps, sd-Arab, syr, ug, ur, qps-plocm) {

            margin-left: 40px;

            margin-right: 0;

        }

 

        .sectionpage .itemslist .win-groupheader .group-subtitle {

            -ms-grid-row: 1;

            margin-bottom: 14px;

            margin-top: 6px;

            max-height: 48pt;

            overflow: hidden;

        }

 

        .sectionpage .itemslist .win-groupheader .group-image {

            -ms-grid-row: 2;

            background-color: rgba(147, 149, 152, 1);

            height: 240px;

            margin: 0;

            margin-bottom: 20px;

            width: 480px;

        }

 

        .sectionpage .itemslist .win-groupheader .group-description {

            -ms-grid-row: 3;

            margin-bottom: 55px;

            overflow: hidden;

        }

 

    .sectionpage .itemslist .win-container {

        margin-bottom: 11px;

        margin-left: 33px;

        margin-right: 33px;

        margin-top: 5px;

    }

 

    .sectionpage .itemslist .item {

        -ms-grid-columns: 110px 10px 1fr;

        -ms-grid-rows: 1fr;

        display: -ms-grid;

        height: 110px;

        padding: 7px;

        width: 480px;

    }

 

        .sectionpage .itemslist .item .item-info {

            -ms-grid-column: 3;

        }

 

            .sectionpage .itemslist .item .item-info .item-title {

                margin-top: 4px;

                max-height: 20px;

                overflow: hidden;

            }

 

            .sectionpage .itemslist .item .item-info .item-description {

                max-height: 60px;

                overflow: hidden;

            }

 

And this is how the source code looks like After changes

Hub.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>hubPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/hub/hub.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/hub/hub.js"></script>

</head>

<body>

    <div class="hubpage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle">Manufacturing Companion</span>

            </h1>

        </header>

 

        <section aria-label="Main content" role="main">

            <!-- Customize the Hub control by modifying the HubSection controls here. -->

 

            <div class="hub" data-win-control="WinJS.UI.Hub">

                <div class="hero" data-win-control="WinJS.UI.HubSection">

                </div>

 

                <!--

                <div class="section1" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section1'} }">

                    <img src="/images/gray.png" width="420" height="280" />

                    <div class="subtext win-type-x-large" data-win-res="{ textContent: 'Section1Subtext' }"></div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                    </div>

                </div>

 

                <div class="section2" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section2'} }">

                    <div class="item-title win-type-medium" data-win-res="{ textContent: 'Section2ItemTitle' }"></div>

                    <div class="article-header win-type-x-large" data-win-res="{ textContent: 'Section2Subtext' }"></div>

                    <div class="win-type-xx-small" data-win-res="{ textContent: 'Section2ItemSubTitle' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                    </div>

                </div>

                -->

 

                <div class="section3" data-win-control="WinJS.UI.HubSection" data-win-res="{ winControl: {'header': 'Section3'} }"

                     data-win-options="{ onheaderinvoked: select('.pagecontrol').winControl.section3HeaderNavigate }">

                    <!--

                    <div class="itemTemplate" data-win-control="WinJS.Binding.Template">

                        <img src="#" data-win-bind="src: backgroundImage; alt: title" />

                        <div class="win-type-medium" data-win-bind="textContent: title"></div>

                        <div class="win-type-small" data-win-bind="textContent: description"></div>

                    </div>

                    -->

                    <div class="itemTemplate" data-win-control="WinJS.Binding.Template">

                        <div class="item">

                            <img class="item-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

                            <div class="item-info">

                                <h4 class="item-title" data-win-bind="textContent: title"></h4>

                                <h6 class="win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>

                                <h4 class="item-description" data-win-bind="textContent: description"></h4>

                            </div>

                        </div>

                    </div>

                    <div class="itemslist win-selectionstylefilled" data-win-control="WinJS.UI.ListView" data-win-options="{

                        layout: {type: WinJS.UI.GridLayout},

                        selectionMode: 'none',

                        itemTemplate: select('.section3 .itemTemplate'),

                        itemDataSource: select('.pagecontrol').winControl.section3DataSource,

                        oniteminvoked: select('.pagecontrol').winControl.section3ItemNavigate

                    }">

                    </div>

                </div>

 

                <!--

                <div class="section4" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section4'} }">

                    <div class="top-image-row">

                        <img src="/images/gray.png" />

                    </div>

                    <div class="sub-image-row">

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                    </div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                    </div>

                </div>

                -->

            </div>

        </section>

    </div>

</body>

</html>

 

Hub.css

.hubpage header[role=banner] {

    position: relative;

    z-index: 2;

}

 

.hubpage section[role=main] {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

    z-index: 1;

}

 

.hubpage .hub .win-hub-surface {

    height: 100%;

}

 

.hubpage .hub .hero {

    -ms-high-contrast-adjust: none;

    background-image: url(/images/gears.jpg);

    background-size: cover;

    margin-left: -80px;

    margin-right: 80px;

    padding: 0;

    width: 780px;

}

 

    .hubpage .hub .hero:-ms-lang(ar, dv, fa, he, ku-Arab, pa-Arab, prs, ps, sd-Arab, syr, ug, ur, qps-plocm) {

        margin-left: 80px;

        margin-right: -80px;

    }

 

    .hubpage .hub .hero .win-hub-section-header {

        display: none;

    }

 

.hubpage .hub .section1 {

    width: 420px;

}

 

    .hubpage .hub .section1 .win-hub-section-content {

        overflow-y: hidden;

    }

 

    .hubpage .hub .section1 .subtext {

        margin-bottom: 7px;

        margin-top: 9px;

    }

 

.hubpage .hub .section2 {

    width: 440px;

}

 

    .hubpage .hub .section2 .win-hub-section-content {

        overflow-y: hidden;

    }

 

    .hubpage .hub .section2 .item-title {

        margin-top: 4px;

        margin-bottom: 10px;

    }

 

    .hubpage .hub .section2 .article-header {

        margin-bottom: 15px;

    }

 

.hubpage .hub .section3 {

}

 

    .hubpage .hub .section3 .itemslist {

        height: 100%;

        margin-left: -10px;

        margin-right: -10px;

        margin-top: -5px;

    }

 

    .hubpage .hub .section3 .itemslist .win-container {

        margin-bottom: 11px;

        margin-left: 33px;

        margin-right: 33px;

        margin-top: 5px;

    }

 

    .hubpage .hub .section3 .itemslist .item {

        -ms-grid-columns: 110px 10px 1fr;

        -ms-grid-rows: 1fr;

        display: -ms-grid;

        height: 110px;

        padding: 7px;

        width: 480px;

    }

 

        .hubpage .hub .section3 .itemslist .item .item-info {

            -ms-grid-column: 3;

        }

 

            .hubpage .hub .section3 .itemslist .item .item-info .item-title {

                margin-top: 4px;

                max-height: 20px;

                overflow: hidden;

            }

 

            .sectionpage .itemslist .item .item-info .item-description {

                max-height: 60px;

                overflow: hidden;

            }

 

/*

    .hubpage .hub .section3 .win-container {

        margin-bottom: 36px;

        margin-left: 10px;

        margin-right: 10px;

    }

 

    .hubpage .hub .section3 .win-item {

        height: 229px;

        width: 310px;

    }

 

        .hubpage .hub .section3 .win-item img {

            height: 150px;

            margin-bottom: 10px;

            width: 310px;

        }

*/

 

.hubpage .hub .section4 {

    width: 400px;

}

 

    .hubpage .hub .section4 .win-hub-section-content {

        overflow-y: hidden;

    }

 

    .hubpage .hub .section4 .top-image-row {

        height: 260px;

        margin-bottom: 10px;

        width: 400px;

    }

 

        .hubpage .hub .section4 .top-image-row img {

            height: 100%;

            width: 100%;

        }

 

    .hubpage .hub .section4 .sub-image-row {

        margin-bottom: 20px;

        display: -ms-flexbox;

        -ms-flex-flow: row nowrap;

        -ms-flex-pack: justify;

    }

 

        .hubpage .hub .section4 .sub-image-row img {

            height: 95px;

            width: 130px;

        }

 

This is how Overview screen looks like right now

We did a Copy and paste of code from Section to Hub above. The interesting thing is that we didn't introduce a net new code above as we are still modifying templates. Please also note that in Hub.html "class="itemTemplate"" T (capital T). Substitute ".sectionpage" with ".hubpage .hub .section3"

Our next step is to add Demo Data to Production Manager App

For this purpose we will simply Demo Data in Data.js and introduce groups

Let's review how source code looked like Before changes

Data.js

(function () {

    "use strict";

 

    var list = new WinJS.Binding.List();

    var groupedItems = list.createGrouped(

        function groupKeySelector(item) { return item.group.key; },

        function groupDataSelector(item) { return item.group; }

    );

 

    // TODO: Replace the data with your real data.

    // You can add data from asynchronous sources whenever it becomes available.

    generateSampleData().forEach(function (item) {

        list.push(item);

    });

 

    WinJS.Namespace.define("Data", {

        items: groupedItems,

        groups: groupedItems.groups,

        getItemReference: getItemReference,

        getItemsFromGroup: getItemsFromGroup,

        resolveGroupReference: resolveGroupReference,

        resolveItemReference: resolveItemReference

    });

 

    // Get a reference for an item, using the group key and item title as a

    // unique reference to the item that can be easily serialized.

    function getItemReference(item) {

        return [item.group.key, item.title];

    }

 

    // This function returns a WinJS.Binding.List containing only the items

    // that belong to the provided group.

    function getItemsFromGroup(group) {

        return list.createFiltered(function (item) { return item.group.key === group.key; });

    }

 

    // Get the unique group corresponding to the provided group key.

    function resolveGroupReference(key) {

        return groupedItems.groups.getItemFromKey(key).data;

    }

 

    // Get a unique item from the provided string array, which should contain a

    // group key and an item title.

    function resolveItemReference(reference) {

        for (var i = 0; i < groupedItems.length; i++) {

            var item = groupedItems.getAt(i);

            if (item.group.key === reference[0] && item.title === reference[1]) {

                return item;

            }

        }

    }

 

    // Returns an array of sample data that can be added to the application's

    // data list.

    function generateSampleData() {

        var itemContent = "Item Content:";

        var itemDescription = "Item Description:";

        var groupDescription = "Group Description:";

 

        // These three strings encode placeholder images. You will want to set the

        // backgroundImage property in your real data to be URLs to images.

        var darkGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY3B0cPoPAANMAcOba1BlAAAAAElFTkSuQmCC";

        var lightGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY7h4+cp/AAhpA3h+ANDKAAAAAElFTkSuQmCC";

        var mediumGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY5g8dcZ/AAY/AsAlWFQ+AAAAAElFTkSuQmCC";

 

        // Each of these sample groups must have a unique key to be displayed

        // separately.

        var sampleGroups = [

            { key: "group1", title: "Group Title: 1", subtitle: "Group Subtitle: 1", backgroundImage: darkGray, description: groupDescription },

            { key: "group2", title: "Group Title: 2", subtitle: "Group Subtitle: 2", backgroundImage: lightGray, description: groupDescription },

            { key: "group3", title: "Group Title: 3", subtitle: "Group Subtitle: 3", backgroundImage: mediumGray, description: groupDescription },

            { key: "group4", title: "Group Title: 4", subtitle: "Group Subtitle: 4", backgroundImage: lightGray, description: groupDescription },

            { key: "group5", title: "Group Title: 5", subtitle: "Group Subtitle: 5", backgroundImage: mediumGray, description: groupDescription },

            { key: "group6", title: "Group Title: 6", subtitle: "Group Subtitle: 6", backgroundImage: darkGray, description: groupDescription }

        ];

 

        // Each of these sample items should have a reference to a particular

        // group.

        var sampleItems = [

            { group: sampleGroups[0], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[0], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[0], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[0], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[0], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[1], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[1], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[1], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: lightGray },

 

            { group: sampleGroups[2], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[2], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[2], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[2], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[2], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[2], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[2], title: "Item Title: 7", subtitle: "Item Subtitle: 7", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[3], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[3], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[3], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[3], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[3], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[3], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: lightGray },

 

            { group: sampleGroups[4], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[4], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[4], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[4], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[5], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[5], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[5], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[5], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[5], title: "Item Title: 7", subtitle: "Item Subtitle: 7", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 8", subtitle: "Item Subtitle: 8", description: itemDescription, content: itemContent, backgroundImage: lightGray }

        ];

 

        return sampleItems;

    }

})();

 

Now we'll look at how source code looks like After changes

Data.js

(function () {

    "use strict";

 

    var list = new WinJS.Binding.List();

    var groupedItems = list.createGrouped(

        function groupKeySelector(item) { return item.group.key; },

        function groupDataSelector(item) { return item.group; }

    );

 

    // TODO: Replace the data with your real data.

    // You can add data from asynchronous sources whenever it becomes available.

    generateSampleData().forEach(function (item) {

        list.push(item);

    });

 

    WinJS.Namespace.define("Data", {

        items: groupedItems,

        groups: groupedItems.groups,

        getItemReference: getItemReference,

        getItemsFromGroup: getItemsFromGroup,

        resolveGroupReference: resolveGroupReference,

        resolveItemReference: resolveItemReference

    });

 

    // Get a reference for an item, using the group key and item title as a

    // unique reference to the item that can be easily serialized.

    function getItemReference(item) {

        return [item.group.key, item.title];

    }

 

    // This function returns a WinJS.Binding.List containing only the items

    // that belong to the provided group.

    function getItemsFromGroup(group) {

        return list.createFiltered(function (item) { return item.group.key === group.key; });

    }

 

    // Get the unique group corresponding to the provided group key.

    function resolveGroupReference(key) {

        return groupedItems.groups.getItemFromKey(key).data;

    }

 

    // Get a unique item from the provided string array, which should contain a

    // group key and an item title.

    function resolveItemReference(reference) {

        for (var i = 0; i < groupedItems.length; i++) {

            var item = groupedItems.getAt(i);

            if (item.group.key === reference[0] && item.title === reference[1]) {

                return item;

            }

        }

    }

 

    // Returns an array of sample data that can be added to the application's

    // data list.

    function generateSampleData() {

       var itemContent = "Item Content:";

        var itemDescription = "Item Description:";

        var groupDescription = "Group Description:";

 

        // These three strings encode placeholder images. You will want to set the

        // backgroundImage property in your real data to be URLs to images.

        var darkGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY3B0cPoPAANMAcOba1BlAAAAAElFTkSuQmCC";

        var lightGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY7h4+cp/AAhpA3h+ANDKAAAAAElFTkSuQmCC";

        var mediumGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY5g8dcZ/AAY/AsAlWFQ+AAAAAElFTkSuQmCC";

 

        // Each of these sample groups must have a unique key to be displayed

        // separately.

        /*

        var sampleGroups = [

            { key: "group1", title: "Group Title: 1", subtitle: "Group Subtitle: 1", backgroundImage: darkGray, description: groupDescription },

            { key: "group2", title: "Group Title: 2", subtitle: "Group Subtitle: 2", backgroundImage: lightGray, description: groupDescription },

            { key: "group3", title: "Group Title: 3", subtitle: "Group Subtitle: 3", backgroundImage: mediumGray, description: groupDescription },

            { key: "group4", title: "Group Title: 4", subtitle: "Group Subtitle: 4", backgroundImage: lightGray, description: groupDescription },

            { key: "group5", title: "Group Title: 5", subtitle: "Group Subtitle: 5", backgroundImage: mediumGray, description: groupDescription },

            { key: "group6", title: "Group Title: 6", subtitle: "Group Subtitle: 6", backgroundImage: darkGray, description: groupDescription }

        ];

        */

 

        var sampleGroups = [

            { key: "current", title: "Current orders", subtitle: "Current orders", backgroundImage: darkGray, description: groupDescription },

            { key: "delayed", title: "Delayed orders", subtitle: "Delayed orders", backgroundImage: lightGray, description: groupDescription }

        ];

 

        // Each of these sample items should have a reference to a particular

        // group.

        /*

        var sampleItems = [

            { group: sampleGroups[0], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[0], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[0], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[0], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[0], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[1], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[1], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[1], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: lightGray },

 

            { group: sampleGroups[2], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[2], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[2], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[2], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[2], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[2], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[2], title: "Item Title: 7", subtitle: "Item Subtitle: 7", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[3], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[3], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[3], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[3], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[3], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[3], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: lightGray },

 

            { group: sampleGroups[4], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[4], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[4], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[4], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[5], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[5], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[5], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[5], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[5], title: "Item Title: 7", subtitle: "Item Subtitle: 7", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 8", subtitle: "Item Subtitle: 8", description: itemDescription, content: itemContent, backgroundImage: lightGray }

        ];

        */

 

        var sampleItems = [

            { group: sampleGroups[0], title: "Production order 101", subtitle: "Production order 101", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[0], title: "Production order 102", subtitle: "Production order 102", description: itemDescription, content: itemContent, backgroundImage: darkGray },

 

            { group: sampleGroups[1], title: "Production order 201", subtitle: "Production order 201", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[1], title: "Production order 202", subtitle: "Production order 202", description: itemDescription, content: itemContent, backgroundImage: mediumGray }

        ];

 

        return sampleItems;

    }

})();

 

 

Now after we populated required minimum Demo Data I'll introduce some more adjustments in Overview screen. This time I'll copy headerTemplate from Grid. Please also note isHeaderStatic: true, this is because I don't want Section header to be clickable (actionable)

Hub.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>hubPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/hub/hub.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/hub/hub.js"></script>

</head>

<body>

    <div class="hubpage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle">Manufacturing Companion</span>

            </h1>

        </header>

 

        <section aria-label="Main content" role="main">

            <!-- Customize the Hub control by modifying the HubSection controls here. -->

 

            <div class="hub" data-win-control="WinJS.UI.Hub">

                <div class="hero" data-win-control="WinJS.UI.HubSection">

                </div>

 

                <!--

                <div class="section1" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section1'} }">

                    <img src="/images/gray.png" width="420" height="280" />

                    <div class="subtext win-type-x-large" data-win-res="{ textContent: 'Section1Subtext' }"></div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                    </div>

                </div>

 

                <div class="section2" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section2'} }">

                    <div class="item-title win-type-medium" data-win-res="{ textContent: 'Section2ItemTitle' }"></div>

                    <div class="article-header win-type-x-large" data-win-res="{ textContent: 'Section2Subtext' }"></div>

                    <div class="win-type-xx-small" data-win-res="{ textContent: 'Section2ItemSubTitle' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                    </div>

                </div>

                -->

 

                <div class="section3" data-win-control="WinJS.UI.HubSection" data-win-res="{ winControl: {'header': 'Section3'} }"

                     data-win-options="{ isHeaderStatic: true }">

                    <!--

                        data-win-options="{ onheaderinvoked: select('.pagecontrol').winControl.section3HeaderNavigate }"

                    -->

                    <div class="headerTemplate" style="color: black;" data-win-control="WinJS.Binding.Template">

                        <button class="group-header win-type-x-large" data-win-bind="groupKey: key"

                                onclick="Application.navigator.pageControl.navigateToGroup(event.srcElement.groupKey)" style="background-color: white; border-color: white;">

                            <span class="group-title" data-win-bind="textContent: title"></span>

                        </button>

                    </div>

                    <!--

                    <div class="itemTemplate" data-win-control="WinJS.Binding.Template">

                        <img src="#" data-win-bind="src: backgroundImage; alt: title" />

                        <div class="win-type-medium" data-win-bind="textContent: title"></div>

                        <div class="win-type-small" data-win-bind="textContent: description"></div>

                    </div>

                    -->

                    <div class="itemTemplate" data-win-control="WinJS.Binding.Template">

                        <div class="item">

                            <img class="item-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

                            <div class="item-info">

                                <h4 class="item-title" data-win-bind="textContent: title"></h4>

                                <h6 class="win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>

                                <h4 class="item-description" data-win-bind="textContent: description"></h4>

                            </div>

                        </div>

                    </div>

                    <div class="itemslist win-selectionstylefilled" data-win-control="WinJS.UI.ListView" data-win-options="{

                        layout: {type: WinJS.UI.GridLayout},

                        selectionMode: 'none',

                        groupHeaderTemplate: select('.section3 .headerTemplate'),

                        groupDataSource: select('.pagecontrol').winControl.section3GroupDataSource,

                        itemTemplate: select('.section3 .itemTemplate'),

                        itemDataSource: select('.pagecontrol').winControl.section3ItemDataSource,

                        oniteminvoked: select('.pagecontrol').winControl.section3ItemNavigate

                    }">

                        <!--

                        groupHeaderTemplate: select('.section3 .headerTemplate'),

                        groupDataSource: select('.pagecontrol').winControl.section3GroupDataSource,

                        itemDataSource: select('.pagecontrol').winControl.section3ItemDataSource,

                        -->

                    </div>

                </div>

 

                <!--

                <div class="section4" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section4'} }">

                    <div class="top-image-row">

                        <img src="/images/gray.png" />

                    </div>

                    <div class="sub-image-row">

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                    </div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                    </div>

                </div>

                -->

            </div>

        </section>

    </div>

</body>

</html>

 

Now as I changed the way how I work with groups I'll also need to do appropriate adjustments in Hub.js

Hub.js

(function () {

    "use strict";

 

    var nav = WinJS.Navigation;

    var session = WinJS.Application.sessionState;

    var util = WinJS.Utilities;

 

    // Get the groups used by the data-bound sections of the Hub.

    /*

    var section3Group = Data.resolveGroupReference("group4");

    var section3Items = Data.getItemsFromGroup(section3Group);

    */

    var section3Groups = Data.groups;

    var section3Items = Data.items;

 

    WinJS.UI.Pages.define("/pages/hub/hub.html", {

        processed: function (element) {

            return WinJS.Resources.processAll(element);

        },

 

        // This function is called whenever a user navigates to this page. It

        // populates the page elements with the app's data.

        ready: function (element, options) {

            var hub = element.querySelector(".hub").winControl;

            hub.onheaderinvoked = function (args) {

                args.detail.section.onheaderinvoked(args);

            };

            hub.onloadingstatechanged = function (args) {

                if (args.srcElement === hub.element && args.detail.loadingState === "complete") {

                    hub.onloadingstatechanged = null;

                    hub.element.focus();

                }

            }

 

            // TODO: Initialize the page here.

        },

 

        navigateToGroup: function (key) {

            nav.navigate("/pages/section/section.html", { groupKey: key });

        },

 

        /*

        section3DataSource: section3Items.dataSource,

        */

        section3GroupDataSource: section3Groups.dataSource,

        section3ItemDataSource: section3Items.dataSource,

 

        /*

        section3HeaderNavigate: util.markSupportedForProcessing(function (args) {

            nav.navigate("/pages/section/section.html", { title: args.detail.section.header, groupKey: section3Group.key });

        }),

        */       

 

        section3ItemNavigate: util.markSupportedForProcessing(function (args) {

            var item = Data.getItemReference(section3Items.getAt(args.detail.itemIndex));

            nav.navigate("/pages/item/item.html", { item: item });

        }),

 

        unload: function () {

           // TODO: Respond to navigations away from this page.

        },

 

        updateLayout: function (element) {

            /// <param name="element" domElement="true" />

 

            // TODO: Respond to changes in layout.

        },

    });

})();

 

Before we take a look at the app again I will do one more adjustment related to Section3 header (Production orders)

Resources.resjson

// For details on localizing a Windows app, see: http://go.microsoft.com/fwlink/?LinkId=212836

 

{

    "Section1": "Section 1",

    "Section1Subtext": "Lorem ipsum dolor sit nonumy sed consectetuer ising elit, sed diam",

    "Section1Description": "Lorem ipsum dolor sit amet, consectetur ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis nisl ut wisi quipexerci quis consequat minim veniam, quis nostrud. exerci tation ullam corper.",

 

    "Section2": "Section 2",

    "Section2ItemTitle": "Item Title",

    "Section2ItemSubtitle": "Item Sub Title",

    "Section2Subtext": "Quisque in porta lorem dolor amet sed consectetuer ising elit, sed diam non my nibh uis mod wisi quip.",

    "Section2Description": "Lorem ipsum dolor sit amet, consectetur ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis nisl ut wisi quipexerci quis consequat minim veniam, quis nostrud. exerci tation ullam corper.",

   

    "Section3": "Production orders",

   

    "Section4": "Section 4",

    "Section4Description": "Lorem ipsum dolor sit amet, consectetur ising elit, sed diam nonummy nibh uismod tincidunt ut laoreet suscipit lobortis nisl ut wisi quipexerci quis consequat minim veniam, quis nostrud. exerci tation ullam corper.",

 

    "DescriptionText": "Description text:",

    "SectionSubtitle": "Section subtitle"

}

 

Now Overview screen looks like this

Please note that now we have a meaningful Prodcution orders Demo Data displayed in groups 

In fact if you navigate to Group screen you will see that Section title is Undefined

In order to fix that we'll resolve group reference explicitly as shown below

Section.js

(function () {

    "use strict";

 

    var ui = WinJS.UI;

 

    ui.Pages.define("/pages/section/section.html", {

        /// <field type="WinJS.Binding.List" />

        _items: null,

 

        processed: function (element) {

            return WinJS.Resources.processAll(element);

        },

 

        // This function is called to initialize the page.

        init: function (element, options) {

            var group = Data.resolveGroupReference(options.groupKey);

            this._items = Data.getItemsFromGroup(group);

            var pageList = this._items.createGrouped(

                function groupKeySelector(item) { return group.key; },

                function groupDataSelector(item) { return group; }

            );

            //this.groupDataSource = pageList.groups.dataSource;

            this.itemDataSource = pageList.dataSource;

            this.itemInvoked = ui.eventHandler(this._itemInvoked.bind(this));

        },

 

        // This function is called whenever a user navigates to this page.

        ready: function (element, options) {

            /*

            element.querySelector("header[role=banner] .pagetitle").textContent = options.title;

            */

            var group = Data.resolveGroupReference(options.groupKey);

            element.querySelector("header[role=banner] .pagetitle").textContent = group.title;

 

            var listView = element.querySelector(".itemslist").winControl;

            listView.element.focus();

        },

 

        unload: function () {

            this._items.dispose();

        },

 

        // This function updates the page layout in response to layout changes.

        updateLayout: function (element) {

            /// <param name="element" domElement="true" />

 

            // TODO: Respond to changes in layout.

        },

 

        _itemInvoked: function (args) {

            var item = this._items.getAt(args.detail.itemIndex);

            WinJS.Navigation.navigate("/pages/item/item.html", { item: Data.getItemReference(item) });

        }

    });

})();

 

 

Now Group screen will have a valid title

By now we aligned a layout of Overview and Group screens and it will make sense to introduce some real Demo data into the app

Data.js

(function () {

    "use strict";

 

    var list = new WinJS.Binding.List();

    var groupedItems = list.createGrouped(

        function groupKeySelector(item) { return item.group.key; },

        function groupDataSelector(item) { return item.group; }

    );

 

    // TODO: Replace the data with your real data.

    // You can add data from asynchronous sources whenever it becomes available.

    generateSampleData().forEach(function (item) {

        list.push(item);

    });

 

    WinJS.Namespace.define("Data", {

        items: groupedItems,

        groups: groupedItems.groups,

        getItemReference: getItemReference,

        getItemsFromGroup: getItemsFromGroup,

        resolveGroupReference: resolveGroupReference,

        resolveItemReference: resolveItemReference

    });

 

    // Get a reference for an item, using the group key and item title as a

    // unique reference to the item that can be easily serialized.

    function getItemReference(item) {

        return [item.group.key, item.title];

    }

 

    // This function returns a WinJS.Binding.List containing only the items

    // that belong to the provided group.

    function getItemsFromGroup(group) {

        return list.createFiltered(function (item) { return item.group.key === group.key; });

    }

 

    // Get the unique group corresponding to the provided group key.

    function resolveGroupReference(key) {

        return groupedItems.groups.getItemFromKey(key).data;

    }

 

    // Get a unique item from the provided string array, which should contain a

    // group key and an item title.

    function resolveItemReference(reference) {

        for (var i = 0; i < groupedItems.length; i++) {

            var item = groupedItems.getAt(i);

            if (item.group.key === reference[0] && item.title === reference[1]) {

                return item;

            }

        }

    }

 

    // Returns an array of sample data that can be added to the application's

    // data list.

    function generateSampleData() {

        var itemContent = "Item Content:";

        var itemDescription = "Item Description:";

        var groupDescription = "Group Description:";

 

        // These three strings encode placeholder images. You will want to set the

        // backgroundImage property in your real data to be URLs to images.

        var darkGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY3B0cPoPAANMAcOba1BlAAAAAElFTkSuQmCC";

        var lightGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY7h4+cp/AAhpA3h+ANDKAAAAAElFTkSuQmCC";

        var mediumGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY5g8dcZ/AAY/AsAlWFQ+AAAAAElFTkSuQmCC";

 

        // Each of these sample groups must have a unique key to be displayed

        // separately.

        /*

        var sampleGroups = [

            { key: "group1", title: "Group Title: 1", subtitle: "Group Subtitle: 1", backgroundImage: darkGray, description: groupDescription },

            { key: "group2", title: "Group Title: 2", subtitle: "Group Subtitle: 2", backgroundImage: lightGray, description: groupDescription },

            { key: "group3", title: "Group Title: 3", subtitle: "Group Subtitle: 3", backgroundImage: mediumGray, description: groupDescription },

            { key: "group4", title: "Group Title: 4", subtitle: "Group Subtitle: 4", backgroundImage: lightGray, description: groupDescription },

            { key: "group5", title: "Group Title: 5", subtitle: "Group Subtitle: 5", backgroundImage: mediumGray, description: groupDescription },

            { key: "group6", title: "Group Title: 6", subtitle: "Group Subtitle: 6", backgroundImage: darkGray, description: groupDescription }

        ];

        */

 

        var sampleGroups = [

            { key: "current", title: "Current orders", subtitle: "Current orders", backgroundImage: darkGray, description: groupDescription, name: "Current orders" },

            { key: "delayed", title: "Delayed orders", subtitle: "Delayed orders", backgroundImage: lightGray, description: groupDescription, name: "Delayed orders" }

        ];

 

        // Each of these sample items should have a reference to a particular

        // group.

        /*

        var sampleItems = [

            { group: sampleGroups[0], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[0], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[0], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[0], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[0], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[1], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[1], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[1], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: lightGray },

 

            { group: sampleGroups[2], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[2], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[2], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[2], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[2], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[2], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[2], title: "Item Title: 7", subtitle: "Item Subtitle: 7", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[3], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[3], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[3], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[3], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[3], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[3], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: lightGray },

 

            { group: sampleGroups[4], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[4], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[4], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[4], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[5], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[5], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[5], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[5], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[5], title: "Item Title: 7", subtitle: "Item Subtitle: 7", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 8", subtitle: "Item Subtitle: 8", description: itemDescription, content: itemContent, backgroundImage: lightGray }

        ];

        */

 

        var sampleItems = [

            { group: sampleGroups[0], title: "Production order 101", subtitle: "Production order 101", description: itemDescription, content: itemContent, backgroundImage: lightGray,

            name: "Production #101", id: "101", state: "Scheduled", product: "Product 01", operator: "Alex Anikiev", qty: 1},

            { group: sampleGroups[0], title: "Production order 102", subtitle: "Production order 102", description: itemDescription, content: itemContent, backgroundImage: darkGray,

            name: "Production #102", id: "102", state: "Scheduled", product: "Product 02", operator: "Alex Anikiev", qty: 1},

 

            { group: sampleGroups[1], title: "Production order 201", subtitle: "Production order 201", description: itemDescription, content: itemContent, backgroundImage: darkGray,

            name: "Production #201", id: "201", state: "Started", product: "Product 03", operator: "Alex Anikiev", qty: 1},

            { group: sampleGroups[1], title: "Production order 202", subtitle: "Production order 202", description: itemDescription, content: itemContent, backgroundImage: mediumGray,

            name: "Production #202", id: "202", state: "Started", product: "Product 04", operator: "Alex Anikiev", qty: 1}

        ];

 

        return sampleItems;

    }

})();

 

 

At this point Overview and Group screens look good and it is time to modify Item screen appropriately

Let's review how source code looked like Before changes

Item.css

.itempage .content {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

    display: block;

    height: 100%;

    overflow-x: auto;

    position: relative;

    width: 100%;

    z-index: 0;

}

 

    .itempage .content article {

        /* Define a multi-column, horizontally scrolling article by default. */

        column-fill: auto;

        column-gap: 80px;

        column-width: 480px;

        height: calc(100% - 183px);

        margin-left: 120px;

        margin-right: 120px;

        margin-top: 133px;

        width: 480px;

    }

 

        .itempage .content article header .item-title {

            margin-bottom: 19px;

        }

 

        .itempage .content article header .item-subtitle {

            margin-bottom: 16px;

            margin-top: 0;

        }

 

        .itempage .content article .item-image {

            height: 240px;

            width: 460px;

        }

 

        .itempage .content article .item-content p {

            margin-top: 10px;

            margin-bottom: 20px;

        }

 

@media screen and (-ms-view-state: snapped) {

    .itempage .content {

        -ms-grid-row: 2;

        -ms-grid-row-span: 1;

        overflow-x: hidden;

        overflow-y: auto;

    }

 

        .itempage .content article {

            /* Define a single column, vertically scrolling article in snapped mode. */

            -ms-grid-columns: 300px 1fr;

            -ms-grid-row: 2;

            -ms-grid-rows: auto 60px;

            display: -ms-grid;

            height: 100%;

            margin-left: 20px;

            margin-right: 20px;

            margin-top: 6px;

            width: 280px;

        }

 

            .itempage .content article header .item-title {

                margin-bottom: 10px;

            }

 

            .itempage .content article .item-image {

                height: 140px;

                width: 280px;

            }

 

            .itempage .content article .item-content {

                padding-bottom: 60px;

                width: 280px;

            }

}

 

@media screen and (-ms-view-state: fullscreen-portrait) {

    .itempage .content article {

        margin-left: 100px;

        margin-right: 100px;

    }

}

 

Item.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>itemPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/item/item.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/item/item.js"></script>

</head>

<body>

    <!-- The content that will be loaded and displayed. -->

    <div class="itempage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle"></span>

            </h1>

        </header>

        <section class="content" aria-label="Main content" role="main">

            <article>

                <div>

                    <header>

                        <h2 class="item-title"></h2>

                        <h4 class="item-subtitle"></h4>

                    </header>

                    <img class="item-image" src="#" />

                    <div class="item-content"></div>

                </div>

            </article>

        </section>

    </div>

</body>

</html>

 

Item.js

(function () {

    "use strict";

 

    WinJS.UI.Pages.define("/pages/item/item.html", {

        // This function is called whenever a user navigates to this page. It

        // populates the page elements with the app's data.

        ready: function (element, options) {

            var item = Data.resolveItemReference(options.item);

            element.querySelector(".titlearea .pagetitle").textContent = item.title;

            element.querySelector("article .item-title").textContent = item.title;

            element.querySelector("article .item-subtitle").textContent = item.subtitle;

            element.querySelector("article .item-image").src = item.backgroundImage;

            element.querySelector("article .item-image").alt = item.subtitle;

            element.querySelector("article .item-content").innerHTML = item.content;

            element.querySelector(".content").focus();

        }

    });

})();

 

I'd also recommend you to open Item page in Blend (<article>) to get better insight into page layout

The idea now is to add more info about Production order on Item screen

Let's look at how source code looks like After changes

Item.css

.itempage .content {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

    display: block;

    height: 100%;

    overflow-x: auto;

    position: relative;

    width: 100%;

    z-index: 0;

}

 

    .itempage .content article {

        /* Define a multi-column, horizontally scrolling article by default. */       

        column-fill: auto;

        column-gap: 80px;

        column-width: 480px;

        height: calc(100% - 183px);

        margin-left: 120px;

        margin-right: 120px;

        margin-top: 133px;

        width: 480px;     

        display: -ms-grid;

        -ms-grid-columns: 550px 250px 350px 1fr;                

    }

       

        .itempage .content article .overview {   

                    -ms-grid-column: 1;                

        }

            

                    .itempage .content article .overview .item-image {

                           height: 520px;

                           width: 520px;

                    }

            

             .itempage .content article .details {   

                    -ms-grid-column: 2;                                      

        }                       

                                       

             .itempage .content article .other {

                    -ms-grid-column: 3;                      

        }

                          

             /*

             .itempage .content article header .item-title {

            margin-bottom: 19px;

        }

 

        .itempage .content article header .item-subtitle {

            margin-bottom: 16px;

            margin-top: 0;

        }      

 

        .itempage .content article .item-image {

            height: 240px;

            width: 460px;

            -ms-grid-column: 1;

        }

 

        .itempage .content article .item-content p {

            margin-top: 10px;

            margin-bottom: 20px;

            -ms-grid-column: 3;

        }

             */

            

@media screen and (-ms-view-state: snapped) {

    .itempage .content {

        -ms-grid-row: 2;

        -ms-grid-row-span: 1;

        overflow-x: hidden;

        overflow-y: auto;

    }

 

        .itempage .content article {

            /* Define a single column, vertically scrolling article in snapped mode. */

            -ms-grid-columns: 300px 1fr;          

            -ms-grid-row: 2;

            -ms-grid-rows: auto 60px;           

            display: -ms-grid;

            height: 100%;

            margin-left: 20px;

            margin-right: 20px;

            margin-top: 6px;

            width: 280px;

        }

 

            .itempage .content article header .item-title {

                margin-bottom: 10px;

            }

 

            .itempage .content article .item-image {

                height: 140px;

                width: 280px;

            }

 

            .itempage .content article .item-content {

                padding-bottom: 60px;

                width: 280px;

            }

}

 

@media screen and (-ms-view-state: fullscreen-portrait) {

    .itempage .content article {

        margin-left: 100px;

        margin-right: 100px;

    }

}

 

 

Item.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>itemPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/item/item.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/item/item.js"></script>

</head>

<body>

    <!-- The content that will be loaded and displayed. -->

    <div class="itempage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle"></span>

            </h1>

        </header>

        <section class="content" aria-label="Main content" role="main">

            <article>

                <!--

                           <div>

                    <header>                

                        <h2 class="item-title"></h2>

                        <h4 class="item-subtitle"></h4>                   

                    </header>

                    <img class="item-image" src="#" />

                    <div class="item-content"></div>

                </div>

                           -->

                           <div class="overview">

                    <h2>Overview</h2>

                    <img class="item-image" src="#" />

                </div>

                <div class="details">

                    <h2>&nbsp;</h2>

                    <div class="item-name">name</div>

                    <div class="item-id">id</div>

                    <div class="item-group">group</div>

                    <div class="item-state">state</div>

                    <div class="item-product">product</div>

                    <div class="item-operator">operator</div>

                    <div class="item-qty">qty</div>

                </div>

                <div class="other">

                    <h2>Other</h2>

                </div>

            </article>

        </section>

    </div>

</body>

</html>

 

After we've done necessary changes we can see how page layout was visually changed in Blend

Blend

The only thing left now is to supply appropriate Demo Data in Item.js 

Item.js

(function () {

    "use strict";

 

    WinJS.UI.Pages.define("/pages/item/item.html", {

        // This function is called whenever a user navigates to this page. It

        // populates the page elements with the app's data.

        ready: function (element, options) {

            var item = Data.resolveItemReference(options.item);

            element.querySelector(".titlearea .pagetitle").textContent = item.title;

            /*

            element.querySelector("article .item-title").textContent = item.title;

            element.querySelector("article .item-subtitle").textContent = item.subtitle;

            element.querySelector("article .item-image").src = item.backgroundImage;

            element.querySelector("article .item-image").alt = item.subtitle;

            element.querySelector("article .item-content").innerHTML = item.content;

            */

            //element.querySelector("article .overview .item-image").src = item.image;

            element.querySelector("article .details .item-name").textContent = "Name: " + item.name;

            element.querySelector("article .details .item-id").textContent = "ID :" + item.id;

            element.querySelector("article .details .item-group").textContent = "Group: " + item.group.name;

            element.querySelector("article .details .item-state").textContent = "State: " + item.state;

            element.querySelector("article .details .item-product").textContent = "Product: " + item.product;

            element.querySelector("article .details .item-operator").textContent = "Operator: " + item.operator;        

            element.querySelector("article .details .item-qty").textContent = "Quantity: " + item.qty;

            element.querySelector(".content").focus();

        }

    });

})();

 

Now Item screen looks like this

Please note that in order to define table layout for Item screen we used "ms-grid" property in CSS

Next we'll come back to Hub and Section pages in order to modify ListView to display appropriate information

Hub.css

.hubpage header[role=banner] {

    position: relative;

    z-index: 2;

}

 

.hubpage section[role=main] {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

    z-index: 1;

}

 

.hubpage .hub .win-hub-surface {

    height: 100%;

}

 

.hubpage .hub .hero {

    -ms-high-contrast-adjust: none;

    background-image: url(/images/gears.jpg);

    background-size: cover;

    margin-left: -80px;

    margin-right: 80px;

    padding: 0;

    width: 780px;

}

 

    .hubpage .hub .hero:-ms-lang(ar, dv, fa, he, ku-Arab, pa-Arab, prs, ps, sd-Arab, syr, ug, ur, qps-plocm) {

        margin-left: 80px;

        margin-right: -80px;

    }

 

    .hubpage .hub .hero .win-hub-section-header {

        display: none;

    }

 

.hubpage .hub .section1 {

    width: 420px;

}

 

    .hubpage .hub .section1 .win-hub-section-content {

        overflow-y: hidden;

    }

 

    .hubpage .hub .section1 .subtext {

        margin-bottom: 7px;

        margin-top: 9px;

    }

 

.hubpage .hub .section2 {

    width: 440px;

}

 

    .hubpage .hub .section2 .win-hub-section-content {

        overflow-y: hidden;

    }

 

    .hubpage .hub .section2 .item-title {

        margin-top: 4px;

        margin-bottom: 10px;

    }

 

    .hubpage .hub .section2 .article-header {

        margin-bottom: 15px;

    }

 

.hubpage .hub .section3 {

}

 

    .hubpage .hub .section3 .itemslist {

        height: 100%;

        margin-left: -10px;

        margin-right: -10px;

        margin-top: -5px;

    }

 

    .hubpage .hub .section3 .itemslist .win-container {

        margin-bottom: 11px;

        margin-left: 33px;

        margin-right: 33px;

        margin-top: 5px;

    }

 

    .hubpage .hub .section3 .itemslist .item {

        -ms-grid-columns: 110px 10px 1fr;

        -ms-grid-rows: 1fr;

        display: -ms-grid;

        height: 110px;

        padding: 7px;

        width: 480px;

    }

 

        .hubpage .hub .section3 .itemslist .item .item-info {

            -ms-grid-column: 3;

        }

 

            /*

            .hubpage .hub .section3 .itemslist .item .item-info .item-title {

                margin-top: 4px;

                max-height: 20px;

                overflow: hidden;

            }

 

            .sectionpage .itemslist .item .item-info .item-description {

               max-height: 60px;

                overflow: hidden;

            }

            */

 

/*

    .hubpage .hub .section3 .win-container {

        margin-bottom: 36px;

        margin-left: 10px;

        margin-right: 10px;

    }

 

    .hubpage .hub .section3 .win-item {

        height: 229px;

        width: 310px;

    }

 

        .hubpage .hub .section3 .win-item img {

            height: 150px;

            margin-bottom: 10px;

            width: 310px;

        }

*/

 

.hubpage .hub .section4 {

    width: 400px;

}

 

    .hubpage .hub .section4 .win-hub-section-content {

        overflow-y: hidden;

    }

 

    .hubpage .hub .section4 .top-image-row {

        height: 260px;

        margin-bottom: 10px;

        width: 400px;

    }

 

        .hubpage .hub .section4 .top-image-row img {

            height: 100%;

            width: 100%;

        }

 

    .hubpage .hub .section4 .sub-image-row {

        margin-bottom: 20px;

        display: -ms-flexbox;

        -ms-flex-flow: row nowrap;

        -ms-flex-pack: justify;

    }

 

        .hubpage .hub .section4 .sub-image-row img {

            height: 95px;

            width: 130px;

        }

 

Hub.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>hubPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/hub/hub.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/hub/hub.js"></script>

</head>

<body>

    <div class="hubpage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle">Manufacturing Companion</span>

            </h1>

        </header>

 

        <section aria-label="Main content" role="main">

            <!-- Customize the Hub control by modifying the HubSection controls here. -->

 

            <div class="hub" data-win-control="WinJS.UI.Hub">

                <div class="hero" data-win-control="WinJS.UI.HubSection">

                </div>

 

                <!--

                <div class="section1" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section1'} }">

                    <img src="/images/gray.png" width="420" height="280" />

                    <div class="subtext win-type-x-large" data-win-res="{ textContent: 'Section1Subtext' }"></div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                        <span data-win-res="{ textContent: 'Section1Description' }"></span>

                    </div>

                </div>

 

                <div class="section2" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section2'} }">

                    <div class="item-title win-type-medium" data-win-res="{ textContent: 'Section2ItemTitle' }"></div>

                    <div class="article-header win-type-x-large" data-win-res="{ textContent: 'Section2Subtext' }"></div>

                    <div class="win-type-xx-small" data-win-res="{ textContent: 'Section2ItemSubTitle' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                        <span data-win-res="{ textContent: 'Section2Description' }"></span>

                    </div>

                </div>

                -->

 

                <div class="section3" data-win-control="WinJS.UI.HubSection" data-win-res="{ winControl: {'header': 'Section3'} }"

                     data-win-options="{ isHeaderStatic: true }">

                    <!--

                        data-win-options="{ onheaderinvoked: select('.pagecontrol').winControl.section3HeaderNavigate }"

                    -->

                    <div class="headerTemplate" style="color: black;" data-win-control="WinJS.Binding.Template">

                        <button class="group-header win-type-x-large" data-win-bind="groupKey: key"

                                onclick="Application.navigator.pageControl.navigateToGroup(event.srcElement.groupKey)" style="background-color: white; border-color: white;">

                            <span class="group-title" data-win-bind="textContent: title"></span>

                        </button>

                    </div>

                    <!--

                   <div class="itemTemplate" data-win-control="WinJS.Binding.Template">

                        <img src="#" data-win-bind="src: backgroundImage; alt: title" />

                        <div class="win-type-medium" data-win-bind="textContent: title"></div>

                        <div class="win-type-small" data-win-bind="textContent: description"></div>

                    </div>

                    -->

                    <div class="itemTemplate" data-win-control="WinJS.Binding.Template">

                        <div class="item">

                            <img class="item-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

                            <div class="item-info">

                                <!--

                                <h4 class="item-title" data-win-bind="textContent: title"></h4>

                                <h6 class="win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>

                                <h4 class="item-description" data-win-bind="textContent: description"></h4>

                                -->

                                <h2 class="item-name" data-win-bind="textContent: name"></h2>

                                <h2 class="item-id" data-win-bind="textContent: id"></h2>

                                <h2 class="item-state" data-win-bind="textContent: state"></h2>

                            </div>

                        </div>

                    </div>

                    <div class="itemslist win-selectionstylefilled" data-win-control="WinJS.UI.ListView" data-win-options="{

                        layout: {type: WinJS.UI.GridLayout},

                        selectionMode: 'none',

                        groupHeaderTemplate: select('.section3 .headerTemplate'),

                        groupDataSource: select('.pagecontrol').winControl.section3GroupDataSource,

                        itemTemplate: select('.section3 .itemTemplate'),

                        itemDataSource: select('.pagecontrol').winControl.section3ItemDataSource,

                        oniteminvoked: select('.pagecontrol').winControl.section3ItemNavigate

                    }">

                        <!--

                        groupHeaderTemplate: select('.section3 .headerTemplate'),

                        groupDataSource: select('.pagecontrol').winControl.section3GroupDataSource,

                        itemDataSource: select('.pagecontrol').winControl.section3ItemDataSource,

                        -->

                    </div>

                </div>

 

                <!--

                <div class="section4" data-win-control="WinJS.UI.HubSection" data-win-options="{ isHeaderStatic: true }" data-win-res="{ winControl: {'header': 'Section4'} }">

                    <div class="top-image-row">

                        <img src="/images/gray.png" />

                    </div>

                    <div class="sub-image-row">

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                        <img src="/images/gray.png" />

                    </div>

                    <div class="win-type-medium" data-win-res="{ textContent: 'DescriptionText' }"></div>

                    <div class="win-type-small">

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                        <span data-win-res="{ textContent: 'Section4Description' }"></span>

                    </div>

                </div>

                -->

            </div>

        </section>

    </div>

</body>

</html>

 

Okay, we now can see the data we wanted to display on ListView tiles

I like what we've got on Hub page, so I'm going to copy-and-paste this code into Section from Hub

Section.css

.sectionpage section[role=main] {

    -ms-grid-row: 1;

    -ms-grid-row-span: 2;

}

 

.sectionpage .itemslist {

    height: 100%;

    position: relative;

    width: 100%;

    z-index: 0;

}

 

    /* This selector is used to prevent ui-dark/light.css from overwriting changes

       to .win-surface. */

    .sectionpage .itemslist .win-horizontal.win-viewport .win-surface {

        margin-bottom: 35px;

        margin-left: 50px;

        margin-right: 50px;

        margin-top: 128px;

    }

 

    .sectionpage .itemslist .win-groupheader {

        -ms-grid-columns: 1fr;

        -ms-grid-rows: auto auto 1fr;

        display: -ms-grid;

        height: 100%;

        margin-left: 0;

        margin-right: 40px;

        padding: 0;

        width: 480px;

    }

 

        .sectionpage .itemslist .win-groupheader:-ms-lang(ar, dv, fa, he, ku-Arab, pa-Arab, prs, ps, sd-Arab, syr, ug, ur, qps-plocm) {

            margin-left: 40px;

            margin-right: 0;

        }

 

        .sectionpage .itemslist .win-groupheader .group-subtitle {

            -ms-grid-row: 1;

            margin-bottom: 14px;

            margin-top: 6px;

            max-height: 48pt;

            overflow: hidden;

        }

 

        .sectionpage .itemslist .win-groupheader .group-image {

            -ms-grid-row: 2;

            background-color: rgba(147, 149, 152, 1);

            height: 240px;

            margin: 0;

            margin-bottom: 20px;

            width: 480px;

        }

 

        .sectionpage .itemslist .win-groupheader .group-description {

            -ms-grid-row: 3;

            margin-bottom: 55px;

            overflow: hidden;

        }

 

    .sectionpage .itemslist .win-container {

        margin-bottom: 11px;

        margin-left: 33px;

        margin-right: 33px;

        margin-top: 5px;

    }

 

    .sectionpage .itemslist .item {

        -ms-grid-columns: 110px 10px 1fr;

        -ms-grid-rows: 1fr;

        display: -ms-grid;

        height: 110px;

        padding: 7px;

        width: 480px;

    }

 

        .sectionpage .itemslist .item .item-info {

            -ms-grid-column: 3;

        }

 

            /*

            .sectionpage .itemslist .item .item-info .item-title {

                margin-top: 4px;

                max-height: 20px;

                overflow: hidden;

            }

 

            .sectionpage .itemslist .item .item-info .item-description {

                max-height: 60px;

                overflow: hidden;

            }

            */

 

Section.html

<!DOCTYPE html>

<html>

<head>

    <meta charset="utf-8" />

    <title>sectionPage</title>

 

    <!-- WinJS references -->

    <link href="//Microsoft.WinJS.2.0/css/ui-light.css" rel="stylesheet" />

    <script src="//Microsoft.WinJS.2.0/js/base.js"></script>

    <script src="//Microsoft.WinJS.2.0/js/ui.js"></script>

 

    <link href="/css/default.css" rel="stylesheet" />

    <link href="/pages/section/section.css" rel="stylesheet" />

    <script src="/js/data.js"></script>

    <script src="/pages/section/section.js"></script>

</head>

<body>

    <!-- These templates are used to display each item in the ListView declared below. -->

    <!--

    <div class="headertemplate" data-win-control="WinJS.Binding.Template">

        <h2 class="group-subtitle" data-win-res="{ 'innerHTML': 'SectionSubtitle' }"></h2>

        <img class="group-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

        <h4 class="group-description" data-win-bind="innerHTML: description"></h4>

    </div>

    -->

    <div class="itemtemplate" data-win-control="WinJS.Binding.Template">

        <div class="item">

            <img class="item-image" src="#" data-win-bind="src: backgroundImage; alt: title" />

            <div class="item-info">

                <!--

                <h4 class="item-title" data-win-bind="textContent: title"></h4>

                <h6 class="win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>

                <h4 class="item-description" data-win-bind="textContent: description"></h4>

                -->

                <h2 class="item-name" data-win-bind="textContent: name"></h2>

                <h2 class="item-id" data-win-bind="textContent: id"></h2>

                <h2 class="item-state" data-win-bind="textContent: state"></h2>

            </div>

        </div>

    </div>

 

    <!-- The content that will be loaded and displayed. -->

    <div class="sectionpage fragment">

        <header aria-label="Header content" role="banner">

            <button data-win-control="WinJS.UI.BackButton"></button>

            <h1 class="titlearea win-type-ellipsis">

                <span class="pagetitle"></span>

            </h1>

        </header>

        <section aria-label="Main content" role="main">

            <div class="itemslist win-selectionstylefilled" aria-label="List of this section's items" data-win-control="WinJS.UI.ListView" data-win-options="{

                    selectionMode: 'none',

                    layout: {type: WinJS.UI.GridLayout, groupHeaderPosition: 'left'},

                    currentItem: {type: WinJS.UI.ObjectType.item, index: 0, hasFocus: true},                    

                    itemDataSource: select('.pagecontrol').winControl.itemDataSource,

                    itemTemplate: select('.itemtemplate'),

                    oniteminvoked: select('.pagecontrol').winControl.itemInvoked

                }">

                <!--

                    groupDataSource: select('.pagecontrol').winControl.groupDataSource,

                    groupHeaderTemplate: select('.headertemplate'),

                -->

            </div>

        </section>

    </div>

</body>

</html>

 

Now the list of grouped Production orders on Group screen looks exactly like Production orders list on Overview screen

Of course, to make our app look cool we'll need to add some graphical elements such as Pictures

To simplify the task I'll add a default image for the product produced by Production order - Gear

After I copied this image to images folder I'll also add it to the project

Now logically we'd need to modify our Demo Data to account for Images

Data.js

(function () {

    "use strict";

 

    var list = new WinJS.Binding.List();

    var groupedItems = list.createGrouped(

        function groupKeySelector(item) { return item.group.key; },

        function groupDataSelector(item) { return item.group; }

    );

 

    // TODO: Replace the data with your real data.

    // You can add data from asynchronous sources whenever it becomes available.

   generateSampleData().forEach(function (item) {

        list.push(item);

    });

 

    WinJS.Namespace.define("Data", {

        items: groupedItems,

        groups: groupedItems.groups,

        getItemReference: getItemReference,

        getItemsFromGroup: getItemsFromGroup,

        resolveGroupReference: resolveGroupReference,

        resolveItemReference: resolveItemReference

    });

 

    // Get a reference for an item, using the group key and item title as a

    // unique reference to the item that can be easily serialized.

    function getItemReference(item) {

        return [item.group.key, item.title];

    }

 

    // This function returns a WinJS.Binding.List containing only the items

    // that belong to the provided group.

    function getItemsFromGroup(group) {

        return list.createFiltered(function (item) { return item.group.key === group.key; });

    }

 

    // Get the unique group corresponding to the provided group key.

    function resolveGroupReference(key) {

        return groupedItems.groups.getItemFromKey(key).data;

    }

 

    // Get a unique item from the provided string array, which should contain a

    // group key and an item title.

    function resolveItemReference(reference) {

        for (var i = 0; i < groupedItems.length; i++) {

            var item = groupedItems.getAt(i);

            if (item.group.key === reference[0] && item.title === reference[1]) {

                return item;

            }

        }

    }

 

    // Returns an array of sample data that can be added to the application's

    // data list.

    function generateSampleData() {

        var itemContent = "Item Content:";

        var itemDescription = "Item Description:";

        var groupDescription = "Group Description:";

 

        // These three strings encode placeholder images. You will want to set the

        // backgroundImage property in your real data to be URLs to images.

        var darkGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY3B0cPoPAANMAcOba1BlAAAAAElFTkSuQmCC";

        var lightGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY7h4+cp/AAhpA3h+ANDKAAAAAElFTkSuQmCC";

        var mediumGray = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY5g8dcZ/AAY/AsAlWFQ+AAAAAElFTkSuQmCC";

 

        var defaultimg = "../../images/gear.png";

 

        // Each of these sample groups must have a unique key to be displayed

        // separately.

        /*

        var sampleGroups = [

            { key: "group1", title: "Group Title: 1", subtitle: "Group Subtitle: 1", backgroundImage: darkGray, description: groupDescription },

            { key: "group2", title: "Group Title: 2", subtitle: "Group Subtitle: 2", backgroundImage: lightGray, description: groupDescription },

            { key: "group3", title: "Group Title: 3", subtitle: "Group Subtitle: 3", backgroundImage: mediumGray, description: groupDescription },

            { key: "group4", title: "Group Title: 4", subtitle: "Group Subtitle: 4", backgroundImage: lightGray, description: groupDescription },

            { key: "group5", title: "Group Title: 5", subtitle: "Group Subtitle: 5", backgroundImage: mediumGray, description: groupDescription },

            { key: "group6", title: "Group Title: 6", subtitle: "Group Subtitle: 6", backgroundImage: darkGray, description: groupDescription }

        ];

        */

 

        var sampleGroups = [

            { key: "current", title: "Current orders", subtitle: "Current orders", backgroundImage: darkGray, description: groupDescription, name: "Current orders" },

            { key: "delayed", title: "Delayed orders", subtitle: "Delayed orders", backgroundImage: lightGray, description: groupDescription, name: "Delayed orders" }

        ];

 

        // Each of these sample items should have a reference to a particular

        // group.

        /*

        var sampleItems = [

            { group: sampleGroups[0], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[0], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[0], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[0], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[0], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[1], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[1], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[1], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: lightGray },

 

            { group: sampleGroups[2], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[2], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[2], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[2], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[2], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[2], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[2], title: "Item Title: 7", subtitle: "Item Subtitle: 7", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[3], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[3], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[3], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[3], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[3], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[3], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: lightGray },

 

            { group: sampleGroups[4], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[4], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[4], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[4], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

 

            { group: sampleGroups[5], title: "Item Title: 1", subtitle: "Item Subtitle: 1", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[5], title: "Item Title: 2", subtitle: "Item Subtitle: 2", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 3", subtitle: "Item Subtitle: 3", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[5], title: "Item Title: 4", subtitle: "Item Subtitle: 4", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 5", subtitle: "Item Subtitle: 5", description: itemDescription, content: itemContent, backgroundImage: lightGray },

            { group: sampleGroups[5], title: "Item Title: 6", subtitle: "Item Subtitle: 6", description: itemDescription, content: itemContent, backgroundImage: mediumGray },

            { group: sampleGroups[5], title: "Item Title: 7", subtitle: "Item Subtitle: 7", description: itemDescription, content: itemContent, backgroundImage: darkGray },

            { group: sampleGroups[5], title: "Item Title: 8", subtitle: "Item Subtitle: 8", description: itemDescription, content: itemContent, backgroundImage: lightGray }

       ];

        */

 

        var sampleItems = [

            { group: sampleGroups[0], title: "Production order 101", subtitle: "Production order 101", description: itemDescription, content: itemContent, /*backgroundImage: lightGray,*/ image: defaultimg, backgroundImage: defaultimg,

            name: "Production #101", id: "101", state: "Scheduled", product: "Product 01", operator: "Alex Anikiev", qty: 1},

            { group: sampleGroups[0], title: "Production order 102", subtitle: "Porduction order 102", description: itemDescription, content: itemContent, /*backgroundImage: darkGray,*/ image: defaultimg, backgroundImage: defaultimg,

            name: "Production #102", id: "102", state: "Scheduled", product: "Product 02", operator: "Alex Anikiev", qty: 1},

 

            { group: sampleGroups[1], title: "Production order 201", subtitle: "Production order 201", description: itemDescription, content: itemContent, /*backgroundImage: darkGray,*/ image: defaultimg, backgroundImage: defaultimg,

            name: "Production #201", id: "201", state: "Started", product: "Product 03", operator: "Alex Anikiev", qty: 1},

            { group: sampleGroups[1], title: "Production order 202", subtitle: "Production order 202", description: itemDescription, content: itemContent, /*backgroundImage: mediumGray,*/ image: defaultimg, backgroundImage: defaultimg,

            name: "Production #202", id: "202", state: "Started", product: "Product 04", operator: "Alex Anikiev", qty: 1}

        ];

 

        return sampleItems;

    }

})();

 

As the result we'll see images on Overview and Item screens

 

For Item screen we'll also need to supply image information in Item.js

Item.js

(function () {

    "use strict";

 

    WinJS.UI.Pages.define("/pages/item/item.html", {

        // This function is called whenever a user navigates to this page. It

        // populates the page elements with the app's data.

        ready: function (element, options) {

            var item = Data.resolveItemReference(options.item);

            element.querySelector(".titlearea .pagetitle").textContent = item.title;

            /*

            element.querySelector("article .item-title").textContent = item.title;

            element.querySelector("article .item-subtitle").textContent = item.subtitle;

            element.querySelector("article .item-image").src = item.backgroundImage;

            element.querySelector("article .item-image").alt = item.subtitle;

            element.querySelector("article .item-content").innerHTML = item.content;

            */           

            element.querySelector("article .overview .item-image").src = item.image;

            element.querySelector("article .details .item-name").textContent = "Name: " + item.name;

            element.querySelector("article .details .item-id").textContent = "ID :" + item.id;

            element.querySelector("article .details .item-group").textContent = "Group: " + item.group.name;

            element.querySelector("article .details .item-state").textContent = "State: " + item.state;

            element.querySelector("article .details .item-product").textContent = "Product: " + item.product;

            element.querySelector("article .details .item-operator").textContent = "Operator: " + item.operator;           

            element.querySelector("article .details .item-qty").textContent = "Quantity: " + item.qty;

           

            element.querySelector(".content").focus();

        }

    });

})();

 

Resulting Item screen will look like this

Before we launch and try out our app we'll also modify Splash screen background to simply make it "white"

Package.appxmanifest

<?xml version="1.0" encoding="utf-8"?>

<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">

 

  <Identity

    Name="53ba864c-9e2b-492e-89be-46632dbb7a6c"

    Version="1.0.0.0"

    Publisher="CN=Alex" />

 

  <Properties>

    <DisplayName>Manufacturing Companion</DisplayName>

    <PublisherDisplayName>Alex</PublisherDisplayName>

    <Logo>images\storelogo.png</Logo>

  </Properties>

 

  <Prerequisites>

    <OSMinVersion>6.3.0</OSMinVersion>

    <OSMaxVersionTested>6.3.0</OSMaxVersionTested>

  </Prerequisites>

 

  <Resources>

    <Resource Language="x-generate" />

  </Resources>

 

  <Applications>

    <Application

      Id="App"

      StartPage="default.html">

 

      <m2:VisualElements

        DisplayName="Manufacturing Companion"

        Description="Manufacturing Companion"

        ForegroundText="light"

        BackgroundColor="white"

        Square150x150Logo="images\Logo.png"

        Square30x30Logo="images\SmallLogo.png">

        <!--

        BackgroundColor="#464646"

        -->

        <m2:SplashScreen Image="images\splashscreen.png" />

 

      </m2:VisualElements>

    </Application>

  </Applications>

 

  <Capabilities>

    <Capability Name="internetClient" />

  </Capabilities>

 

</Package>

 

 

The final step in this walkthrough will be to add Logo

Please notice blank "logo" files in images folder Before I changed them

 

For the sake of simplicity I used the same Gear image for the logo

Please see how "logo" files look like After changes

As the result Splash screen will look like the following

Now let's summarize the results. Within about 1 hour I was able to transform standard Visual Studio 2013 Hub App template to meet the needs of my Production Manager App

Let's look at the result of Milestone 1 Production Manager App displaying info about Production orders

Obviosuly there're more things to be done in this App before you could use it in production which I will cover in my next articles, but hopefully this walkthrough gives you an idea about how to make use of existing Visual Studio templates to boost up your progress 

Milestone 1: Manufacturing Companion App with embedded Demo Data

I my next walkthroughs I'll go further into details and cover other aspects of modern Windows 8 Apps development. I'll remind you that in this walkthrough I wanted to focus on User Interface. Obvisoubly it is very important to have a robust Web Services layer and Communication Infrastructure

In conclusion I'll provide an example of modern Windows 8 App built by Memex Automation Inc. implementing Machine Operator workload. This app is powered by robust Web Services layer providing realtime data about equipment and machines on the shop floor including detailed OEE metrics, so Machine Operator can be well informed about how equipment and machines operate at all times. This app is called Merlin Companion and it is available in the Store   

Merlin Companion

Merlin Companion

Please find more info about Memex Automation Inc. and Merlin product here: http://www.memex.ca/

Summary: This document describes how use standard Visual Studio 2013 Hub App template in order to very quickly build a modern Windows 8 App which implements a real-world Manufacturing industry scenario for Production Manager role. I also provided an example of the app built by partner – Memex Automation Inc. for Machine Operator role using rapid business app development technique.

Please note that Microsoft continues to actively work on developing new modern Windows 8 Apps and implementing new workloads. For example, at Convergence 2014 a brand new Microsoft Shop Floor Control – Machine Operator App was presented. This app allows to perform job registrations against Shop Floor Control jobs in Microsoft Dynamics AX 2012 (start jobs, stop jobs, take a break, etc.), report good/bad quantities and much more. I'm sure a lot of companies across the globe will greatly benefit from using new Microsoft Shop Floor Control – Machine Operator App. I definitely recommend you to check it out!            

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP, Apps, Windows 8.1, Visual Studio 2013, HTML5, CSS, JavaScript, Grid App, Hub App, User Interface, Manufacturing, Production Manager.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples.

6 comments:

  1. Awesome .. Thanks. Can you share source code?

    ReplyDelete
    Replies
    1. Hi Muhammad!

      Thanks for your interest in this topic!

      Full source code in fact is listed in the article itself
      The idea is that you can start with standard Visual Studio 2013 template and turn it into a business app
      If we will follow the steps from the beginning step by step and simply copy the code one-to-one in your project, you will get results exactly how I describe them on each step and get to the result at the end

      Also you can find this particular project source code in zip file on my Microsoft OneDrive here: http://1drv.ms/OqwD8y

      Thanks!

      Best Regards,
      /Alex

      Delete
  2. Thanks Alex for this awesome tutorial. Desperately waiting for next part of this series.

    ReplyDelete