2

我正在尝试用模板设计这样的东西

在此处输入图像描述

但我不能在data.js中有这段代码:

var sampleItems = [
    { group: sampleGroups[0], importancia: "alta", 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 }
];

当我尝试在groupedItem.html 中将新选项添加​​到此部分时:

<div class="itemtemplate" data-win-control="WinJS.Binding.Template">
    <div class="item" data-win-bind="className: importancia">
        <img class="item-image" src="#" data-win-bind="src: backgroundImage; alt: title" />
        <div class="item-overlay">
            <h4 class="item-title" data-win-bind="textContent: title" style="margin-left: 0px; margin-right: 291.08px;"></h4>
            <h6 class="item-subtitle win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>
        </div>
    </div>
</div>

结果是这样的:

在此处输入图像描述

我该如何解决?我没有在 CSS 中添加任何东西

4

1 回答 1

0

首先,您需要在 data.js 文件中为您想要的组指定数据项的数量。然后按照这个MSDN 教程编辑 groupitem js 和 css 文件。你会找到你想要的

于 2013-01-25T22:48:45.113 回答