on 2015 Jun 11 8:46 AM
Hello,
I am trying to read the data of a particular row from an sap.m.table using below code:
var selRowContext = rowtable.getBindingContext(SelctdRow);
var rowmodel = rowtable.getModel();
SelectStatus = rowmodel.getProperty("Status", selRowContext);
but selRowContext doesn't support by m.tables, instead getProperty(Status) cannot be read as per the declaration defined in sdk.
Request clarification before answering.
this is how we define in XML view:
var selRowIndex = rowtable.indexOfItem(oSelectedItem)+1;
and for Binding the context as Kuntal Sarkar explained above:
var path= oEvent.getParameter('listItem').getBindingContext().getPath();
var selectedRow= this.byId('Table_ID').getModel().getProperty(path);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkathesh,
for mTable I think this way it will work.
in the controller onSelection function you can go like this.
var path= oEvent.getParameter('listItem').getBindingContext().getPath();
now you can use this path reference to locate any particular property values in your table model.
var selectedRow= this.byId('Table_ID').getModel().getProperty(path);
now as per your question to access the property "Status" just you need to do this..
selectedRow.Status
Hope it will help !!
Regard,
Kuntal Sarkar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please mark this Discussion with a Correct Answer (closes, but does not lock the Discussion) and Helpful Answer where appropriate. See http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why Even if you discovered the solution without any outside contributions, it helps others to understand what the solution turned out to be. Do not use Assumed Answered as it confuses anyone looking for the specific answer.
Thanks, Mike (Moderator)
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.