cancel
Showing results for 
Search instead for 
Did you mean: 

Need to Update particular cell of selected Row of table in FIORI app.

0 Kudos

Hi Experts,

I have an functionality of adding row in table and there is option of Fast entry.Suppose i have added 3 rows to table and selected 2 rows in table in which i need to update quantity field.

Now the scenario is like I will select quantity field from dropdown and put some quantity.It will update all as below.

As you can see in above image I have selected 2 rows and want to update quantity field of both selected rows.
Please guide me how to get the selected row and update particular quantity field.

I have done the coding as below partially but need guidance to update particular cell of quantity.

onEditPo: function() { //This code was generated by the layout editor.

var oView = this.getView();

var select = this.getView().byId("FastEntrySelect").getSelectedItem();

var temp = select.getText();

if (temp === "Fixed date and quantity")

{

///update all qty

var oModel = new sap.ui.model.json.JSONModel();

var oTable = this.getView().byId("tableId");

var oselectedItem = oTable.getSelectedItem();

var aggregations = oTable.getAggregation("items");

var index = aggregations.indexOf(oselectedItem);

}

Waiting for response.

Thanks.

Abhi

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member242845
Discoverer
0 Kudos

Hi Abhishek,

var oTable = this.getView().byId("tableId");

var contexts = oTable.getSelectedContexts();

if (contexts.length === 0){

//Line items are not selected

} else {

var items = contexts.map(function(oEvent){

return oEvent.getObject();

});

var i;

for(i=0;i<items.length;i++)

{

var oNewObject = {};

oNewObject = items[i]; //items contains the selected line item data and you can continue with your logic

}

}

Best Regards,

Deepak.