View Full Version : Adding a row (Record) into an existing GroupingStore ???

15 Sep 2010, 7:12 AM
Hi all,

I hope someone can help me. I do not see whats the problem .... : :-?

I have a defined GroupingStore which gets data from a JSONReader (it works!), and now I want to add some additional rows to this store (for testing purposes).

Here is the code:



MyRecordType = Ext.data.Record.create(['title', 'year', 'ref']);
myrec = new MyRecordType({"title":"This ist a Title", "year":"2009", "ref":"testref"});

var dcstore = new Ext.data.GroupingStore({
url: 'widgets/publications.php',
reader: new Ext.data.JsonReader({

root: 'publications',
autoLoad: true,
fields: [{name: 'title', type: 'string'},
{name: 'year', sortType: 'asFloat'},
{name: 'ref', sortType: 'string'}]
}, MyRecordType),

sortInfo:{field: 'year', direction: "ASC"}



The problem is, that the method add(myrec) does not add the data into the store. But the data "myrec" is created correctly.

Some ideas??? Is it maybe because of the root 'publications'??? It is not defined in MyrecordType ...???:-?

Thank you for helping!!!