on 05-16-2017 8:43 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.