Reputation: 4053
I have valid Datagrid
defined on the page with attached ItemFileWriteStore
and normally it show data.
However as soon as data will contain (almost) duplicate entry, I will see Sorry, an error occurred
.
I the code I do not see any data fields definitions beyond DataGrid
columns definitions.
I suppose that store and/or DataGrid
components balk at duplicates, but I do not know how can I change data to avoid those duplicates.
PS my data contain 6 columns duplicates differ only by 3rd column. Is position important? Do sore/datagrid expect 1rst column to be unique? Or first defined datagrid column to be unique?
Dojo: 1.4
Upvotes: 0
Views: 408
Reputation: 34
Did you set identifier? You need something unique (ID) to differentiate datastore items. for example:
var store = new ItemFileReadStore({
data: {
identifier: "id",
items: [
{id: 1, name: 'A'},
{id: 2, name: 'B'},
{id: 3, name: 'c'}
]
}
});
you need to tell the store that your 3rd column is your identifier
Upvotes: 1