Skip to Content
0

Smart Table - Get Row

Aug 20, 2017 at 03:34 PM

145

avatar image
Former Member

Hi Expert,

I am using the Smart Table in my application and TableType = "sap.ui.table".

Please could you help me how to get the selected row based on click on Button.

Thanks & Regards,

Dhiraj

table.jpg (82.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Aug 21, 2017 at 06:33 PM
0

Hi Sharath,

Thanks for reply.

I am not getting the selected row.

My question is- Inside smart table I am using ui.table so how I will get the selected row.

And also column can be in any order because setting functionality is there in smart table so user can hide or show the columns as needed.

Please could you tell me how to get the selected row data.

I written the below code to get the data:

---------------------------------------------------

var totalItem = oTableHUnit.getBinding("rows").getLength(); //oTablePartner.getRows()[0].getCells()[1].getText() /*for (var i = 0; i < 1; i++) { var currentRows = oTablePartner.getRows()[0]; shipfrom = { Kunnr : currentRows.getCells()[1].getText(), Company: currentRows.getCells()[2].getText(), Address1: currentRows.getCells()[3].getText(), City: currentRows.getCells()[4].getText(), State: currentRows.getCells()[5].getText(), Postalcode: currentRows.getCells()[6].getText(), Telephone : currentRows.getCells()[7].getText() }; }

-----------------------------------------------------

Thanks & Regards,

Dhiraj

Share
10 |10000 characters needed characters left characters exceeded
Sharath M G Aug 21, 2017 at 07:24 AM
0

First, get the internal table using <smarttable>.getTable().

It seems like sap.ui.table and for that, you can use - getSelectedIndex

Share
10 |10000 characters needed characters left characters exceeded