Skip to Content
0

Edit the cell which is clicked in sap.m.Table

Oct 30, 2017 at 08:27 AM

17

avatar image
Former Member

I would like to edit the cell in table which is clicked using sap.m.table....

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Arjun Biswas Oct 31, 2017 at 10:33 AM
0

First get the row on which you have clicked in the sap.m.table. Use the following code :

Table in view :

<Table id="table" items="{report>/results}">
														<headerToolbar>
															<Toolbar>
																<Title text="{i18n>reports} :" level="H1" />
															</Toolbar>
														</headerToolbar>
														<columns>
															<Column>
																<Text text="{i18n>name}" />
															</Column>
															<Column minScreenWidth="Tablet" demandPopin="true">
																<Text text="{i18n>title}" />
															</Column>
															<Column minScreenWidth="Tablet" demandPopin="true">
																<Text text="{i18n>country}" />
															</Column>
														</columns>
														<items>
															<ColumnListItem type="Active" press="onItemPress">
																<cells>
																	<Text text="{report>/results/0/Reportuserid}" />
																	<Text text="{report>/results/0/Reportname}" />
																	<Text text="{report>/results/0/Country}" />
																</cells>
															</ColumnListItem>
														</items>
													</Table>


On the press event in the list execute the following function in the controller :

/**
			 * When the table item is pressed 
			 * @public
			 */
			onItemPress:function(evt){
				console.log(evt.getSource().getCells()[0].getText());
			},

From this you can get each of the cells on the row where the user clicks.

Hope this helps,

Regards.

Share
10 |10000 characters needed characters left characters exceeded
Irfan Gokak Oct 31, 2017 at 10:09 AM
0

Hi,

Still have issues?

Share
10 |10000 characters needed characters left characters exceeded