on 05-20-2015 12:29 PM
Hello Experts,
I am using an OData service whose output consists of few repeated rows. I want to display distinct data in the UI and also group the repeated rows. Can this manipulation be done in the service itself ??
Following is the scenario:
Lets say a customer orders same product in two different categories(different packs,but same product). Only one order number is generated for this order, but its displayed twice in the output because categories of product are different. In my table, Order number must be visible only once and under "no of items" 2 must be displayed.(Hence grouping is required).
I hope i have explained my question properly.
Please reply,
Thnak you,
Best Regards,
Chetna
No, this is not possible in the service level, unless you try to do comparison and start blanking out properties in the DPC class.
I would not recommended this as well, as the requirement is more at 'How you display', and not about the data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its not like that i am getting duplicate values, actually the scenario is something like this: if i place an order in flipkart for two different products or same product having different categories or packs alltogether, then though products are different, only one order number will be generated.
Now the output i receive from the service is i think on the basis of products which has been ordered. So when two products which were ordered by a person are displayed , With them the order id will also be displayed. In such cases same order id will be repeated for those two products which were ordered together.
I just want:
(1) to bind Distinct entries to my table, and
(2) group the two entries so that i can display no of items = 2 , for this order number
Do you any idea as to how can i approach dis?
Thank you,
Best Regards
You can not o this from the odata service level . You will need to create another entity as expected and handle this situation from data provider class. Or , you will need to use odata.read() method to call the service after constructing your URL and manipulated thae returned JSON before binding it to the table .
Sree
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.