全部
我现在正在使用 WebOs 3.0 这个问题可能不需要 WebOs 知识。
我的问题是我使用的列表选择器就像一个 HTML 下拉列表。
它的静态代码
{kind: "ListSelector", name: "mySelector"}
this.$.mySelector.setItems( [ { caption: "test 1", value: 1 }, { caption: "test 2", value: 2 } ]);
this.$.mySelector.setValue(2);
动态显示方式
for (var j=0; j<this.cnt; j++)
{
//alert(this.data[j].channelName);
this.$.mySelector.setItems( [ { caption: this.data[j].channelName, value: this.data[j].channelId }]);
}
因为我一直在用“setItems”替换你所有的项目。它只显示我的数据库的最后一个值。