首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从TableSelectDialog中删除/隐藏搜索栏

从TableSelectDialog中删除/隐藏搜索栏
EN

Stack Overflow用户
提问于 2019-09-03 06:18:27
回答 1查看 1.4K关注 0票数 0

我使用一个TableSelectDialog来显示一个包含5-6列的表。我想要删除或隐藏默认搜索栏,并从其页脚删除取消按钮,并添加一个自定义的'OK‘按钮。

代码语言:javascript
复制
    <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
        <TableSelectDialog noDataText="No Indent Found" confirm="handleClose" items="{path: 'Create>/Status'}">
            <ColumnListItem id="item0_1560778285375">
                <cells>
                    <Text text="{Create>IndentNo}" id="indenNo"/>
                    <Text text="{Create>So_no}" id="soNo"/>
                    <Text text="{Create>Vehicle}" id="truckNo"/>
                    <Text text="{Create>Status}" id="status"/>
                </cells>
            </ColumnListItem>
            <columns>
                <Column id="column0" minScreenWidth="Tablet" demandPopin="true">
                    <header>
                        <Label design="Bold" text="Indent No" id="label8"/>
                    </header>
                </Column>
                <Column id="column1" minScreenWidth="Tablet" demandPopin="true">
                    <header>
                        <Label text="Sales Order No." id="label10" design="Bold"/>
                    </header>
                </Column>
                <Column id="column2" minScreenWidth="Tablet" demandPopin="true">
                    <header>
                        <Label text="Vehicle No." id="label9" design="Bold"/>
                    </header>
                </Column>
                <Column id="column3" minScreenWidth="Tablet" demandPopin="true">
                    <header>
                        <Label text="Status" id="statuscolumn" design="Bold"/>
                    </header>
                </Column>
            </columns>
        </TableSelectDialog>
    </core:FragmentDefinition>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-09-03 09:05:05

只需使用基本对话框代替。

这里有相同的事件(部分名称不同),因为TableSelectDialog ist只是对话框的一个方便的控件,还有一些额外的东西,比如搜索栏。

代码语言:javascript
复制
    <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core">
    <Dialog>
        <content>
            <Table mode="SingleSelectMaster" itemPress=".handleClose" noDataText="No Indent Found" items="{path: 'Create>/Status'}">
                <ColumnListItem id="item0_1560778285375">
                    <cells>
                        <Text text="{Create>IndentNo}" id="indenNo"/>
                        <Text text="{Create>So_no}" id="soNo"/>
                        <Text text="{Create>Vehicle}" id="truckNo"/>
                        <Text text="{Create>Status}" id="status"/>
                    </cells>
                </ColumnListItem>
                <columns>
                    <Column id="column0" minScreenWidth="Tablet" demandPopin="true">
                        <header>
                            <Label design="Bold" text="Indent No" id="label8"/>
                        </header>
                    </Column>
                    <Column id="column1" minScreenWidth="Tablet" demandPopin="true">
                        <header>
                            <Label text="Sales Order No." id="label10" design="Bold"/>
                        </header>
                    </Column>
                    <Column id="column2" minScreenWidth="Tablet" demandPopin="true">
                        <header>
                            <Label text="Vehicle No." id="label9" design="Bold"/>
                        </header>
                    </Column>
                    <Column id="column3" minScreenWidth="Tablet" demandPopin="true">
                        <header>
                            <Label text="Status" id="statuscolumn" design="Bold"/>
                        </header>
                    </Column>
                </columns>
            </Table>
        </content>
        <beginButton>
            <Button text="OK" press=".onPressButton"/>
        </beginButton>
    </Dialog>
</core:FragmentDefinition>

请注意,您必须在handleClose/onPressButton函数中手动关闭对话框。

如果要保留TableSelectDialog,可以访问对话框的内容、自定义标题和按钮,如对话框的API所述。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57765983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档