Я пытаюсь получить dragDropInfo для двух таблиц вместо списка.Но когда я пытаюсь использовать oDraggedControl.getTitle (), который возвращает имя перетаскиваемого элемента из списка, выдает ошибку для таблиц.Итак, как я могу получить перетаскиваемый столбец и отброшенное имя столбца?
onDrop: function (oEvent) {
var txt;
if (confirm("Do you want to tag this item?")) {
var sDropPosition = oEvent.getParameter("dropPosition");
var oDraggedControl = oEvent.getParameter("draggedControl");
var oDroppedControl = oEvent.getParameter("droppedControl");
var dragged = oDraggedControl.getTitle(); ---- throwing error
alert(dragged);
sap.m.MessageToast.show(
oDraggedControl.getTitle() +
" is dropped " +
" at the " +
oDroppedControl.getTitle()
);
var dropped = oDroppedControl.getTitle();
sap.m.MessageToast.show(dropped);
} else {
txt = "Action Cancelled";
alert(txt);
}
}
<Table id="container" items="{path: 'container>/ContainerMaster'}" width="auto" noDataText="No data" mode="None" showSeparators="All" growing="true" growingThreshold="44"
growingScrollToLoad="true">
<dragDropConfig>
<dnd:DragDropInfo sourceAggregation="items" targetElement="container1" targetAggregation="items" dropPosition="on" drop="onDrop"
DropEffect="move"/>
</dragDropConfig>
<items>
<ColumnListItem>
<cells>
<core:Icon src="sap-icon://shipping-status" size="48px" color="green" height="48px" width="48px" visible="true"/>
<ObjectIdentifier title="{container>CON_ID}" text="{container>CON_WEIGHT}" titleActive="true" visible="true" titlePress="_onObjectIdentifierTitlePress3"/>
<Text text="{container>CON_WEIGHT}" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit" visible="true"/>
</cells>
</ColumnListItem>
</items>
</Table>
<Table id="container1" items="{path: 'container>/ContainerMaster'}" width="auto" noDataText="No data" mode="None" showSeparators="All" growing="true" growingThreshold="44"
growingScrollToLoad="true">
<dragDropConfig>
<dnd:DragDropInfo sourceAggregation="items" targetElement="container1" targetAggregation="items" dropPosition="on" drop="onDrop"
DropEffect="move"/>
</dragDropConfig>
<items>
<ColumnListItem>
<cells>
<core:Icon src="sap-icon://shipping-status" size="48px" color="green" height="48px" width="48px" visible="true"/>
<ObjectIdentifier title="{container>CON_ID}" text="{container>CON_WEIGHT}" titleActive="true" visible="true" titlePress="_onObjectIdentifierTitlePress3"/>
<Text text="{container>CON_WEIGHT}" width="auto" maxLines="1" wrapping="false" textAlign="Begin" textDirection="Inherit" visible="true"/>
</cells>
</ColumnListItem>
</items>
</Table>