on 08-27-2017 4:33 PM
Hi Expert,
Iam using smarttable from class "sap.ui.comp.smarttable.SmartTable" .
I was not able to find a method to get the selected row .
Please could you help me how to get the selected row based on click on delete button.
<smartTable:SmartTable id="smarttable" entitySet="ZOMPC_DTL_FIORISet" smartFilterId="smartFilterBar" tableType="Table"
useExportToExcel="true" useVariantManagement="false"
useTablePersonalisation="true" header="Line Items"
showRowCount="true" persistencyKey="SmartTableAnalytical_Explored"
enableAutoBinding="true"
app:useSmartField="true" class="sapUiResponsiveContentPadding"
editTogglable="true"
initiallyVisibleFields="Posnr,Prctr,Sdesc,Amount,Status,Unallocated,Realized,Head_qrt_flag,Ordrec_qrt,Ordrec_qrt,Pnl_amount"
tableBindingPath="ZOMPC_DTL_FIORISet">
<smartTable:customToolbar>
<OverflowToolbar design="Transparent">
<ToolbarSpacer/>
<Button icon="sap-icon://add" text="Row" press="addRow"/>
<Button icon="sap-icon://delete" text="Delete" press="deleteRow"/>
</OverflowToolbar>
</smartTable:customToolbar>
</smartTable:SmartTable>
If you have default table inside smart Table you can use all its methods i.e for sap.m.Table.
<smartTable:SmartTable id="smarttable" ... >
<Table id="innerTable" mode="MultiSelect" selectionChange=".onRowSelect">
<columns>
<Column>
<core:CustomData key="p13nData" value='\{"columnKey": "Price", ...
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
...
</cells>
</ColumnListItem>
</items>
</Table>
...
</smartTable>
In your controller you can use selectionChange method or simply:
var selectedRows = this.getView().byId('innerTable').getSelectedItems();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.