当数据源不同时,将Devexpress的dxRadioGroup的ValueExpr设置为枚举值

时间:2019-01-29 14:06:15

标签: typescript enums devexpress devexpress-mvc

我正在使用devexpress的 dxRadioGroup

我想将输出显示为:

Selected (10)
All (235)

我有:

Enum source
{
Selected
All
}

我有一个类型为 source [] 的数组,其中包含文档数

所以我得到的是

[10, 235] (this.allowedSources)

我的代码如下:

SomeId.dxRadioGroup(
                    {
                        items: this.allowedSources,
                        value: this.allowedSources[0],
                        itemTemplate: (data, index, element): void =>
                        {
                            element.append($("<div>").text(source[index] + " " + "(" + data + ")"));
                        }
                    });

因此,我已经设法显示 已选(10) 全部(235)作为输出

但是我想更改dxRadioGroup的 ValueExpr当前包含计数 我希望它是枚举类型 它应该等效于 source.All,source.Selected

我该如何更改?

0 个答案:

没有答案