crp_spaeth
9 May 2009, 4:35 AM
Hi there,
trying to get a direct store running under the Extjs 3.0-rc1.1 and under the current Headversion (3917) breaks with a too much recursion exception.
I was able to break the error down to the following source.
(
function(){
Ext.app.REMOTING_API = {
url: "any url",
type:"remoting",
"actions":
{
"TestAction":
[
{"name":"doEcho","len":1},
{"name":"multiply","len":2},
{"name":"submit","formHandler": true,"len": 1},
{"name":"getData","len": 1},
{"name":"createData","len": 1},
{"name":"deleteData","len": 1},
{"name":"saveData","len": 2}
]
}
};
}
)();
Ext.Direct.addProvider(Ext.app.REMOTING_API);
var reader = new Ext.data.JsonReader({
totalProperty: 'total',
successProperty: 'success',
idProperty: 'id',
root: 'data'
}, [
{ name: 'id' },
{ name: 'email', allowBlank: false },
{ name: 'first', allowBlank: false },
{ name: 'last', allowBlank: false }
]);
var writer = new Ext.data.JsonWriter({
returnJson: true,
writeAllFields: false
});
var store = new Ext.data.DirectStore({
api: {
load: TestAction.getData,
create: TestAction.createData,
save: TestAction.saveData,
destroy: TestAction.deleteData
},
reader: reader,
writer: writer, // <-- plug a DataWriter into the store just as you would a Reader
paramsAsHash: false,
batchSave: false,
prettyUrls: false,
listeners: {
load: function(result) {
},
loadexception: function() {
},
scope: this
}
});
store.load();
It seems to me that there is something wrong in the creating transaction routine.
Since you can set a breakpoint in the queueTransaction methode you will see that the transaction the method gets called with, has a data propertie containing an array. the array then contains an object with a propertie called scope.
Since scope is a self referencing object the encode routine will end up with a too much recursion exception.
trying to get a direct store running under the Extjs 3.0-rc1.1 and under the current Headversion (3917) breaks with a too much recursion exception.
I was able to break the error down to the following source.
(
function(){
Ext.app.REMOTING_API = {
url: "any url",
type:"remoting",
"actions":
{
"TestAction":
[
{"name":"doEcho","len":1},
{"name":"multiply","len":2},
{"name":"submit","formHandler": true,"len": 1},
{"name":"getData","len": 1},
{"name":"createData","len": 1},
{"name":"deleteData","len": 1},
{"name":"saveData","len": 2}
]
}
};
}
)();
Ext.Direct.addProvider(Ext.app.REMOTING_API);
var reader = new Ext.data.JsonReader({
totalProperty: 'total',
successProperty: 'success',
idProperty: 'id',
root: 'data'
}, [
{ name: 'id' },
{ name: 'email', allowBlank: false },
{ name: 'first', allowBlank: false },
{ name: 'last', allowBlank: false }
]);
var writer = new Ext.data.JsonWriter({
returnJson: true,
writeAllFields: false
});
var store = new Ext.data.DirectStore({
api: {
load: TestAction.getData,
create: TestAction.createData,
save: TestAction.saveData,
destroy: TestAction.deleteData
},
reader: reader,
writer: writer, // <-- plug a DataWriter into the store just as you would a Reader
paramsAsHash: false,
batchSave: false,
prettyUrls: false,
listeners: {
load: function(result) {
},
loadexception: function() {
},
scope: this
}
});
store.load();
It seems to me that there is something wrong in the creating transaction routine.
Since you can set a breakpoint in the queueTransaction methode you will see that the transaction the method gets called with, has a data propertie containing an array. the array then contains an object with a propertie called scope.
Since scope is a self referencing object the encode routine will end up with a too much recursion exception.