on 07-06-2017 8:38 PM
Hello UI5 experts,
How can I capture the complete row data upon click of the Edit button in the last column. I have found similar issue in other threads and tried below, but not able to capture the row data.
var oItem = oEvent.getSource().getParent();
var iIndex = oEvent.getSource().getParent().getParent().indexOfItem(oItem);
var sFirst = '/';
var sPath = sFirst.concat( iIndex );
var oTable = sap.ui.getCore().byId("idChangeTable1");
var model = oTable.getModel();
var obj = model.getObject(sPath); // This statement is not returning any values to me
HI
Here is an example.
http://jsbin.com/pulenom/edit?js,output
Please do not attempt the traversal the hierarchy to get the value.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rizwan,
https://sapui5.hana.ondemand.com is the only place where you can refer all the methods. Basically you need to refer the API for particular control. In that if you see that the parents controls methods also will be there.
Thanks,
Anurag
It will get the binding context of the particular row in the table. you can do console.log(oContext); to see the all the properties in the task in f12 window.
Hi Mohammad,
Please try the below one:
var getTabledata = that.getModel("Items").getData().results;
var itemPosition = oEvent.getSource().getParent().getParent().indexOfItem(oEvent.getSource().getParent())
Once you get the item position, you can get the data of the complete row from below
var selctedRowdata = getTabledata[itemPostion]; // this has the complete row info
Regards
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Dennis, your solution worked for me..
var oContext = oEvent.getSource().getBindingContext();
var oObject = oContext.getObject();
Thanks once again..
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 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.