gpt4 book ai didi

javascript - dxSelectBox 不会加载数据

转载 作者:行者123 更新时间:2023-11-30 10:10:47 25 4
gpt4 key购买 nike

根据 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

关于javascript - dxSelectBox 不会加载数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26845459/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com