Skip to Content

Displaying details for odata table in sapui5

Hi Experts,

I have a odata table grouping similar products as below.

On click of a row (POWER_WHEEL_CHAIR) I have to display its details as below

I am able to display the details for one of the product using the code

var oView = this.getView();

var oModel = new sap.ui.model.odata.ODataModel("/sap/c4c/odata/v1/c4codata/");

oModel.read("/ServiceRequestCollection?$filter=CustomerID eq '1001192'", {

success: function(oData, response) {

var oResult = [];

oResult = oData.results;

ibasearray = oResult;

ibasearray = {

service: ibasearray

};

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

var oTable = oView.byId("idibaseTable");

oTable.setModel(oVizFrame3Model);

var oBinding = oTable.getBinding("items"),

oFilter;

oFilter = new Filter("ProductID", "EQ", "POWER_WHEEL_CHAIR");

oBinding.filter([oFilter]);

}

});

I am able to identify which row is clicked using the code

ibasetable = oEvent.getSource().getBindingContext();

Please provide suggestions on how this should be done when there a multiple rows and how to get their details.

Thanks,

Srinivasan

ibase_table.PNG (8.3 kB)
pdt_group.PNG (15.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Sep 09, 2016 at 07:12 PM

    Hi Srinivasan- For that you should enable the expand entity in your ODATA service.

    Regards,

    Karthik A

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.