cancel
Showing results for 
Search instead for 
Did you mean: 

show or hide duplicate records for sap.m.table

former_member209118
Participant
0 Kudos

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.

kammaje_cis
Active Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member340030
Contributor
0 Kudos

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

Answers (1)

Answers (1)

former_member209118
Participant
0 Kudos

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.