PDA

View Full Version : Grid: duplicate entries issue



lucacox
3 Oct 2011, 5:17 AM
Hi all,

i'm developing an extjs 4 application and I'm stuck with this problem:

I have a store, we can say of books, each book has many tags depending on its content. I want to display a list of books grouped by tags, every book should be shown in each group it belongs (via tag).

OK, the problem is that the store is a rest store and returns to me duplicated entries if a book has many tags, es:


{
id: 1,
title: "The title",
author: "The author",
tag: "adventure"
},
{
id: 1,
title: "The title",
author: "The author",
tag: "history"
}


when I load this store into a grouped, by tag, grid only the last entry is shown.

Can anyone tell me if what i want is possible?

Any help is very appreciated

Thaks,
Luca

arthurakay
3 Oct 2011, 10:04 AM
Are you using remote grouping? Since your grid is receiving duplicate entries from the server (which is the desired behavior in your case), I don't understand why you wouldn't have the server process all grid-related data.

The issue boils down to the fact that the data store sees your duplicate objects as individually unique. In other words, you can't ask the grid to assume entries are duplicates in one case and unique objects in another.

It sounds to me that this is a server-side problem, not having anything to do with the ExtJS grid.

skirtle
3 Oct 2011, 5:05 PM
If I've understood correctly...

If it's deduplicating by id then can't you just not return the id, or specify it in an alternative field that won't be treated as an id?

lucacox
4 Oct 2011, 12:20 AM
If I've understood correctly...

If it's deduplicating by id then can't you just not return the id, or specify it in an alternative field that won't be treated as an id?


Thank you, that resolved the problem.

many thanks,
luca