Skip to Content
0

show or hide duplicate records for sap.m.table

Jan 29, 2017 at 10:25 AM

113

avatar image

Hi Experts,

I have a requirement. I have to show or hide the duplicate records for particular row based on the button click for that row. I used mergeDuplicates property but its showing initially and it is applying for all reocrds. But i want that based on button click and only for that record.

10 |10000 characters needed characters left characters exceeded

It is better to explain with an example. It is tough to understand the problem from your description.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
VIPLOVE KHUSHALANI Jan 30, 2017 at 07:30 AM
0

Hi Ashok ,

Actually merge duplicates will only allow to merge field values like kind of grouping(Batch field).

It could be done in many ways but i think of this solutions :

Before binding the list of items(object) to the table you can add a field 'visible' to each object in the array of data.Just for the first entry you can make visible true and for the duplicates one if present to false.

{"Batch":"1","BatchDesc":"batch1",visible:"true"},

{"Batch":"1","BatchDesc":"batch1",visible="false"},

and on the press of the button just get the pressed row Batch value and the whole table binding and change the visible property of each object in the table binding to true whose Batch value equal to batch value of the row pressed.

thanks

Viplove

Share
10 |10000 characters needed characters left characters exceeded
ashok gondi Jan 30, 2017 at 05:47 AM
0

Thanks for your reply.

I have a table with 3 columns(batch,batch description and add button). Let say I have 6 records.

arrar=[

{"Batch":"1","BatchDesc":"batch1"},

{"Batch":"1","BatchDesc":"batch1"},

{"Batch":"2","BatchDesc":"batch2"},

{"Batch":"3","BatchDesc":"batch3"},

{"Batch":"3","BatchDesc":"batch3"},

{"Batch":"4","BatchDesc":"batch3"}

]

When I set this data to my table, I have to show only 4 records(no duplicate). If I press the button for any row I have to show duplicate record for that particular batch.

Ex: If I press the button for batch one , my output screen has to show 5 records

{"Batch":"1","BatchDesc":"batch1"},

{"Batch":"1","BatchDesc":"batch1"},

{"Batch":"2","BatchDesc":"batch2"},

{"Batch":"3","BatchDesc":"batch3"},

{"Batch":"4","BatchDesc":"batch3"}

Thanks,

Ashok.

Share
10 |10000 characters needed characters left characters exceeded