【发布时间】:2014-01-24 03:36:03
【问题描述】:
在winjs中从listView中删除一个项目,这两种方法有什么区别?
方法一
var _dataSource = myList.itemDataSource;
//Start the sequence of edits
_dataSource.beginEdits();
//remove the firstitem
_dataSource.remove(_dataSource.itemFromIndex(0)._value.key);
//Ends the batch of edits
_dataSource.endEdits();
方法二
myList.itemDataSource.list.splice(0, 1); //remove the first in the list
【问题讨论】:
标签: windows-8 winjs windows-8.1