Javascript 从TableSelectDialog中删除/隐藏搜索栏
我使用TableSelectDialog来显示一个包含5-6列的表。我想删除或隐藏默认搜索栏,还想从其页脚中删除“取消”按钮,并添加自定义的“确定”按钮Javascript 从TableSelectDialog中删除/隐藏搜索栏,javascript,xml,sapui5,Javascript,Xml,Sapui5,我使用TableSelectDialog来显示一个包含5-6列的表。我想删除或隐藏默认搜索栏,还想从其页脚中删除“取消”按钮,并添加自定义的“确定”按钮 <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"> <TableSelectDialog noDataText="No Indent Found" confirm="handleClose" items="{path: 'Cr
<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>
只需使用基本对话框即可 同样的事件在这里可以部分使用不同的名称,因为TableSelectDialog只是对话框的一个方便控件,带有一些额外的功能,如搜索栏
<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中所述