根据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();
        },
}


有人可以指出正确的方向吗?

提前致谢

最佳答案

叹...

<div data-bind="dxSelectBox:{datasource


应该用大S读dataSource

09-16 15:27