Windows 8 Metro Javascript 无法创建 ArrayDataSource?
我正在尝试使用 javascript 将一些数据绑定到 win8 中的列表视图。我正在使用的代码是:
var myDS = new WinJS.UI.ArrayDataSource([{id: 1, value: xx}, {id: 2, 值:yy}]); console.log("数据对象已创建");
然而,程序在dataarray创建行被阻塞,并且日志从未显示。
有人知道为什么吗?
I'm trying to bind some data to a listview in win8 using javascript. The code I'm using is:
var myDS = new WinJS.UI.ArrayDataSource([{id: 1, value: xx}, {id: 2,
value: yy}]);
console.log("data obj created");
However, the program was blocked in the dataarray creation line, and the log was never displayed.
Anyone knows why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您似乎没有定义值“xx”和“yy”,这会导致发生已处理的 javascript 异常,这意味着函数中的其余代码将不会执行。
You don't appear to have the values "xx" and "yy" defined which is causing an handled javascript exception to occur which means the remaining code in the function won't execute.
在 Consumer Preview 中,不再使用 ArrayDataSource。
您可以使用
WinJS.Binding.List
来绑定数据。In Consumer Preview, ArrayDataSource is no longer in use.
You can use
WinJS.Binding.List
to bind data.