pouli
6 Oct 2010, 7:43 AM
Hello,
I am trying to do my first JsonStore to work but I keep receiving: recordType is undefined.
Here is the the interesting part:
var TestRecord = Ext.data.Record.create([ // creates a subclass of Ext.data.Record
{name: 'lanID'},
{name: 'translation'}
]);
var writer = new Ext.data.JsonWriter({
encode: true,
writeAllFields : true
});
var reader = new Ext.data.JsonReader({
totalProperty: 'total',
successProperty: 'success',
root: 'data',
idProperty: 'lanID'
},
TestRecord);
var proxy = new Ext.data.HttpProxy({
api: {
read : '/ajax/remote?doAction=AJAX_saveAdditionalRemark&action=read',
create : '/ajax/remote?doAction=AJAX_saveAdditionalRemark&action=create',
update: '/ajax/remote?doAction=AJAX_saveAdditionalRemark&action=update',
destroy: '/ajax/remote?doAction=AJAX_saveAdditionalRemark&action=destroy'
}
});
var propertyStore = new Ext.data.JsonStore({
id: 'user',
autoLoad: false,
proxy: proxy,
writer: writer,
reader: reader,
autoSave: false
});
propertyStore.load();
When I execute this I can see form the firebug that the
"var s = this.meta, Record = this.recordType,"
Record is undefined. Although I specify the type at the reader and I have tried specify the fields at the store with no success.
Any help would be appreciated.
Thank you
I am trying to do my first JsonStore to work but I keep receiving: recordType is undefined.
Here is the the interesting part:
var TestRecord = Ext.data.Record.create([ // creates a subclass of Ext.data.Record
{name: 'lanID'},
{name: 'translation'}
]);
var writer = new Ext.data.JsonWriter({
encode: true,
writeAllFields : true
});
var reader = new Ext.data.JsonReader({
totalProperty: 'total',
successProperty: 'success',
root: 'data',
idProperty: 'lanID'
},
TestRecord);
var proxy = new Ext.data.HttpProxy({
api: {
read : '/ajax/remote?doAction=AJAX_saveAdditionalRemark&action=read',
create : '/ajax/remote?doAction=AJAX_saveAdditionalRemark&action=create',
update: '/ajax/remote?doAction=AJAX_saveAdditionalRemark&action=update',
destroy: '/ajax/remote?doAction=AJAX_saveAdditionalRemark&action=destroy'
}
});
var propertyStore = new Ext.data.JsonStore({
id: 'user',
autoLoad: false,
proxy: proxy,
writer: writer,
reader: reader,
autoSave: false
});
propertyStore.load();
When I execute this I can see form the firebug that the
"var s = this.meta, Record = this.recordType,"
Record is undefined. Although I specify the type at the reader and I have tried specify the fields at the store with no success.
Any help would be appreciated.
Thank you