przemo_li
przemo_li

Reputation: 4053

Dojox grid Datagrid "Sorry, an error occured"

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

Answers (1)

Sonic
Sonic

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

Related Questions