将“全部"值添加到 <Select> 的最佳方法是什么?控制? [英] What&#39;s the best way to add add &#39;All&#39; value to &lt;Select&gt; Control?

查看:38
本文介绍了将“全部"值添加到 <Select> 的最佳方法是什么?控制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

//更新:我在过滤栏

//Update: I use this <select> control in Filter Bar

在UI5的控制中,如果我选择了一个项目,我不能回到非选择状态,所以我想在项目中添加'All'值:

In control of UI5,if I select one item, I can't go back to non-selected state, so I want to add 'All' value in items:

这有效:

<Select>
    <core:Item key="" text="All" />
    <core:Item key="another value" text="another value"/>
</Select>

但是在这个例子中All"消失了:

But "All" disapear in this example:

<Select
    items="{
        path: '/PRODUCTS'
    }">
    <core:Item key="" text="All" />
    <core:Item key="{ID}" text="{Route_Name}" />
</Select>

我该怎么办?

推荐答案

FacetFilter 控件将满足您的要求.它有一个全部选择来选择列表中的所有值.

A FacetFilter control would suit your requirement. It has an all selection to select all the values in the List.

<FacetFilter
            id="idFacetFilter"
            type="Simple"
            confirm="handleConfirm">
            <lists>
                <FacetFilterList
                    title="Route"
                    key="route"
                    mode="MultiSelect"
                    items="{
                        path: '/PRODUCTS'
                    }" >
                    <items>
                        <FacetFilterItem
                            text="{Route_Name}"
                            key="{ID}" />
                    </items>
                </FacetFilterList>
            </lists>
        </FacetFilter>

这篇关于将“全部"值添加到 <Select> 的最佳方法是什么?控制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆