Controls_ListViewWorkingWithDataSources MSDN 샘플에서 WinJS.Binding.List에서 항목을 제거하는 방법을 살펴 보았습니다. 여기에 그 해결책이 나와 있습니다. 더 쉬운 방법이 있다고 말해주세요. 해당 항목이 연속적인 순서가 아닌지 때 목록에서 여러 항목을 삭제하는 지원하기 때문에 MSDN 샘플에서 항목을 제거하는WinJS.Binding.List에서 항목 제거
if (list2.selection.count() > 0) {
list2.selection.getItems().done(function (items) {
//Sort the selection to ensure its in index order
items.sort(function CompareForSort(item1, item2) {
var first = item1.index, second = item2.index;
if (first === second) {
return 0;
}
else if (first < second) {
return -1;
}
else {
return 1;
}
});
//Work backwards as the removal will affect the indices of subsequent items
for (var j = items.length - 1; j >= 0; j--) {
// To remove the items, call splice on the list, passing in a count and no replacements
lettersList.splice(items[j].index, 1);
}
});
그리고 빵은 효과가있었습니다! 고마워요. –