根据 DevExtreme 网站上的演示,我有一个 dxSelectBox,但我无法加载数据。代码如下:
<div data-bind="dxSelectBox:{datasource: themes, displayExpr: 'name', valueExpr: 'themeId', value: themeId }"></div>
var themesArray = [
{ themeId: 1, name: "Android (Dunkel)" },
{ themeId: 2, name: "Desktop" },
{ themeId: 3, name: "iOS" },
{ themeId: 4, name: "Windows 8" },
{ themeId: 5, name: "Windows Phone 8" },
{ themeId: 6, name: "Tizen" },
];
var themes = new DevExpress.data.DataSource(themesArray);
var viewModel = {
themes: themes,
viewShowing: function () {
this.themes.load();
},
}
有人可以指出我正确的方向吗?
提前致谢