我使用一个TableSelectDialog来显示一个包含5-6列的表。我想要删除或隐藏默认搜索栏,并从其页脚删除取消按钮,并添加一个自定义的'OK‘按钮。
<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>发布于 2019-09-03 09:05:05
只需使用基本对话框代替。
这里有相同的事件(部分名称不同),因为TableSelectDialog ist只是对话框的一个方便的控件,还有一些额外的东西,比如搜索栏。
<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所述。
https://stackoverflow.com/questions/57765983
复制相似问题