Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8388563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:29:51+00:00 2026-06-09T18:29:51+00:00

I am developping a metro style application for Windows 8 using HTML5/CSS/JS I’m trying

  • 0

I am developping a metro style application for Windows 8 using HTML5/CSS/JS

I’m trying to display items with different size in a grouped List View. (like all metro style apps do…) I found on the internet that I need to put a GridLayout to my list View and implement the groupInfo. It succeeds in modifying the first item (the picture inside the first item is bigger than the other items), but then all the items have the size of the first item. I would like something like this instead :
example

Here is what I have done :

updateLayout: function (element, viewState, lastViewState) {

        //I get my listView winControl defined in HTML
        var listView = element.querySelector(".blocksList").winControl;

        var globalList = new WinJS.Binding.List(globalArray);
        var groupDataSource = globalList.createGrouped(this.groupKeySelector,
                    this.groupDataSelector, this.groupCompare);

       // I set the options of my listView (the source for the items and the groups +  the grid Layout )
        ui.setOptions(listView, {
            itemDataSource: groupDataSource.dataSource,
            groupDataSource: groupDataSource.groups.dataSource,
            layout: new ui.GridLayout({
                groupHeaderPosition: "top",
                groupInfo: function () {
                    return {
                        multiSize: true,
                        slotWidth: Math.round(480),
                        slotHeight: Math.round(680)
                    };
                }
            }),
            itemTemplate: this.itemRenderer,
             });
    },

    // je définis le template pour mes items
    itemRenderer: function (itemPromise) {
        return itemPromise.then(function (currentItem, recycled) {
            var template = document.querySelector(".itemTemplate").winControl.renderItem(itemPromise, recycled);
            template.renderComplete = template.renderComplete.then(function (elem) {

                //if it is the first item I put it widder
                if (currentItem.data.index == 0) {
                  //  elem.querySelector(".item-container").style.width = (480) + "px";
                    elem.style.width = (2*480) + "px";

                }

              });
            return template.element;
        })
    },

the html part is :

      <section aria-label="Main content" role="main">
      <div class="blocksList" aria-label="List of blocks" data-win-control="WinJS.UI.ListView"
data-win-options="{itemTemplate:select('.itemTemplate'), groupHeaderTemplate:select('.headerTemplate')
                   , selectionMode:'none', swipeBehavior:'none', tapBehavior:'invoke'}">
       </div>
       </section> 


            <!--Templates-->
<div class="headerTemplate" data-win-control="WinJS.Binding.Template">
    <div class="header-title" data-win-bind="innerText: categorieName"/>
</div>

<div class="itemTemplate" data-win-control="WinJS.Binding.Template">
            <div class="item-container" >
                 <div class="item-image-container">
                   <img class="item-image" data-win-bind="src: urlImage" src="#" />
                 </div>
            <div class="item-overlay">
                 <h4 class="item-title" data-win-bind="textContent: title"></h4>
            </div>
         </div>
</div>

et le css

   .newHomePage p {
margin-left: 120px;
 }

 .newHomePage .blocksList {
      -ms-grid-row: 2;
  }

      .newHomePage .blocksList .win-horizontal.win-viewport .win-surface {
         margin-left: 120px;
         margin-bottom: 60px;
     }

    .newHomePage .blocksList .item-container {
    height: 340px;
    width: 240px;
    color: white;
    background-color: red;
    -ms-grid-columns: 1fr;
    -ms-grid-rows: 1fr;
    display: -ms-grid;
    }


    .newHomePage .blocksList .win-item {
       /*-ms-grid-columns: 1fr;
      -ms-grid-rows: 1fr 30px;
      display: -ms-grid;*/
       height: 130px;
      width: 240px;
      background: white;
      outline: rgba(0, 0, 0, 0.8) solid 2px;
     }

Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:29:52+00:00Added an answer on June 9, 2026 at 6:29 pm

    In Release Preview (and also RTM), the property names in the groupInfo function changed:

    • multiSize -> enableCellSpanning
    • slotWidth -> cellWidth
    • slotHeight -> cellHeight

    Try that and see if you get better results. If you don’t announce cell spanning in this way, then the GridLayout takes the first item’s size as that for all the items.

    Chapter 5 of my ebook from Microsoft Press (RTM preview coming soon) will cover all the details of this.

    .Kraig

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a metro app using JavaScript and am trying to display two
I'm developing a Metro-style app (for Windows 8) using C# and XAML. I have
I am developing the metro style application using Win RT. I Need to List
i'm developping an application in CF 3.5 for windows Mobile 6 Pro using C#
I am developing a metro application using visual studio 2012. I am trying to
Yesterday I have started developing my first Metro style App using JavaScript. I've used
I'm developping a Facebook Application (using ASP.NET C# and Nathan Totten's Facebook C# SDK)
I'm developping an application using ActionBarSherlock component. My goal is to target all devices
I am developping my first application in Asp. I am using the environment Asp.NET
I'm developping an application in JSF 2.0, as DBMS I'm using MySQL. I'm having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.