Last active
December 27, 2015 08:09
-
-
Save IgorShadurin/7294060 to your computer and use it in GitHub Desktop.
Простой ListView с реордером. http://msdn.microsoft.com/ru-ru/library/windows/apps/bg182879.aspx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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