Skip to content

Instantly share code, notes, and snippets.

@IgorShadurin
Last active December 27, 2015 08:09
Show Gist options
  • Save IgorShadurin/7294060 to your computer and use it in GitHub Desktop.
Save IgorShadurin/7294060 to your computer and use it in GitHub Desktop.
Простой ListView с реордером. http://msdn.microsoft.com/ru-ru/library/windows/apps/bg182879.aspx
<style type="text/css">
.win-listview {
margin: 20px;
border: 2px solid gray;
Width: 500px;
}
.standardItem {
width: 150px;
height: 150px;
background-color: #0aaddd;
padding: 5px;
}
</style>
<div id="template" data-win-control="WinJS.Binding.Template">
<div class="standardItem" data-win-bind="textContent: title" ></div>
</div>
<div
id="reorderableListView"
data-win-control="WinJS.UI.ListView"
data-win-options="{
itemDataSource: ListViewExamples.dataList.dataSource,
itemTemplate: select('#template'),
layout: {type: WinJS.UI.GridLayout},
itemsReorderable: true
}">
</div>
(function () {
"use strict";
var dataList =
new WinJS.Binding.List(
[{ title: "Item 1" },
{ title: "Item 2" },
{ title: "Item 3" },
{ title: "Item 4" }]);
WinJS.Namespace.define("ListViewExamples",
{
dataList: dataList
})
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment