如您所见,用户界面中有1,1,2个向下移位
我有一个sap.ui.table
,我有一个添加行按钮,它将向表中添加更多行。
表中还有一个包含MultiComboBox的列。现在,如果我一次添加了很多行,并且表格可以垂直滚动。因此,当我向下滚动时,MultiComboBox开始下拉至其他行,尽管它不会影响我绑定到表的模型。如何防止这种情况发生?
<t:Table selectionMode="MultiToggle" columnHeaderHeight="32px" fixedColumnCount="2" visibleRowCount="{tasks>/noOfTasks}" id="taskTable"
class="tasktable" rows="{path: 'tasks>/task' , sorter: [{ path: 'taskNo',comparator:'.comparator.sortTask'}]}" noData="No Tasks" alternateRowColors="true">
<t:toolbar>
<OverflowToolbar>
<Title text="Pending Tasks"></Title>
<ToolbarSpacer/>
<Button icon="sap-icon://request" tooltip="Edit tasks" press="editTask"/>
<Button icon="sap-icon://full-screen" tooltip="show detailed info of the selected task" press="getDetailedInfo"/>
<Button icon="sap-icon://add" text="Add Tasks" class="addTaskButton" press="addNewTask"></Button>
</OverflowToolbar>
</t:toolbar>
<t:columns>
<t:Column width="5rem" hAlign="Center" class="cellBorderLeft cellBorderRight">
<Label required="true" text="Task No."/>
<t:template>
<Text text="{tasks>taskNo}"/>
</t:template>
</t:Column>
<t:Column width="10rem" class="cellBorderRight">
<Label required="true" text="Task Name"/>
<t:template>
<Input value="{tasks>taskName}" editable="{= !(${tasks>exists})}"/>
</t:template>
</t:Column>
<t:Column width="18rem" class="cellBorderRight">
<Label required="true" text="Task Details"/>
<t:template>
<Input value="{tasks>taskDetails}" editable="{= !(${tasks>exists})}"/>
</t:template>
</t:Column>
<t:Column class="cellBorderRight" width="14rem">
<Label required="true" text="Assigned To"/>
<t:template>
<HBox>
<Input value="{tasks>assignedTo}" placeholder="Please Enter the NTID only" editable="{= !(${tasks>exists})}"></Input>
<core:Icon src="sap-icon://search" visible="{= !(${tasks>exists})}" class="searchEmp" press="searchForEmployees"></core:Icon>
</HBox>
</t:template>
</t:Column>
<t:Column class="cellBorderRight" width="12rem">
<Label required="true" text="Priority"/>
<t:template>
<HBox width="99%" class="priorityBox">
<Select width="100%" selectedKey="{tasks>priority}" enabled="{= !(${tasks>exists}) || ${tasks>edit} === true}"
items="{path:'tasks>priorities',templateShareable:false}">
<core:Item key="{tasks>value}" text="{tasks>value}"/>
<core:Item key="{tasks>value}" text="{tasks>value}"/>
<core:Item key="{tasks>value}" text="{tasks>value}"/>
</Select>
</HBox>
</t:template>
</t:Column>
<t:Column class="cellBorderRight" width="10rem">
<Label required="true" text="Start Date"/>
<t:template>
<DatePicker placeholder="Enter date" value="{tasks>startDate}" editable="{= !(${tasks>exists})}" valueFormat="yyyy-MM-dd"
displayFormat="dd-MM-yyyy"/>
</t:template>
</t:Column>
<t:Column class="cellBorderRight" width="10rem">
<Label required="true" text="End Date"/>
<t:template>
<DatePicker placeholder="Enter date" value="{tasks>endDate}" valueFormat="yyyy-MM-dd"
editable="{= !(${tasks>exists}) || ${tasks>edit} === true}" displayFormat="dd-MM-yyyy"/>
</t:template>
</t:Column>
<t:Column class="cellBorderRight" width="8rem">
<Label text="Status"/>
<t:template>
<Text text="{tasks>status}"/>
</t:template>
</t:Column>
<t:Column class="cellBorderRight" width="11rem">
<Label required="true" text="Module"/>
<t:template>
<Input value="{tasks>module}" enabled="{= !(${tasks>exists})}"></Input>
</t:template>
</t:Column>
<t:Column class="cellBorderRight" width="12rem">
<Label text="Dependency"/>
<t:template>
<HBox>
<Input value="{tasks>dependency}" editable="{= !(${tasks>exists})}"
visible="{= ${tasks>exists} === true && ${tasks>edit} === false}"/>
<MultiComboBox id="dependents" visible="{= !(${tasks>exists}) || ${tasks>edit} === true}" selectionChange="onSelectChange"
items="{ path: 'dependents>/dependents',templateShareable:false}">
<core:Item key="{dependents>taskID}" text="{dependents>taskNo}"
enabled="{= ${tasks>dependency}.toString().indexOf(${dependents>taskNo}) ===-1}"/>
</MultiComboBox>
</HBox>
</t:template>
</t:Column>
<t:Column hAlign="Center" class="cellBorderRight" width="22rem">
<Label text="Notes"/>
<t:template>
<Input value="{tasks>notes}" editable="{= !(${tasks>exists}) || ${tasks>edit} === true}"/>
</t:template>
</t:Column>
<t:Column class="cellBorderRight" width="6rem">
<Label text="Attachment"/>
<t:template>
<VBox>
<UploadCollection maximumFilenameLength="5555" maximumFileSize="10"
visible="{= ${tasks>attachmentAdded} === false && ${tasks>exists} === false || ${tasks>edit} === true}" multiple="true"
change="onChange" fileType="txt,doc,png,jpg" uploadComplete="onUploadCompleted" class="taskAttach" instantUpload="false" mode="MultiSelect"
app:taskNo="{tasks>taskNo}"></UploadCollection>
<core:Icon src="sap-icon://attachment" app:files="{tasks>attachments/files}"
visible="{= ${tasks>attachmentAdded} === true && ${tasks>exists} === true && ${tasks>edit} === false}" press="downloadFile"
app:taskNo="{tasks>taskNo}"/>
</VBox>
</t:template>
</t:Column>
</t:columns>
</t:Table>