dedoz
27 Jan 2012, 7:13 PM
just asking before posting a bug
using a trivial record.save() gives me an error
Ext.onReady(function() {
Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
Ext.define('someModel', {
extend: 'Ext.data.Model',
fields: ['id','someField'],
proxy:
{ type: 'direct',
api:{ create : carDefaultQuery.carInsert }
}
});
var myRecord = Ext.create('someModel');
myRecord.set('someField','some text');
myRecord.save();
});
error comes from this library code
Ext.define('Ext.data.proxy.Direct', {
..........
doRequest: function(operation, callback, scope) {
var me = this,
writer = me.getWriter(),
request = me.buildRequest(operation, callback, scope),
fn = me.api[request.action] || me.directFn,
params = request.params,
method,
args;
if (!fn) {
Ext.Error.raise('No direct function specified for this proxy');
}
if (operation.allowWrite()) {
request = writer.write(request);
}
if (operation.action == 'read') {
// We need to pass params
method = fn.directCfg.method;
args = method.getArgs(params, me.paramOrder, me.paramsAsHash);
} else {
args.push(request.jsonData); <-- ERROR, args undefined
}
Ext.apply(request, {
args: args,
directFn: fn
});
args.push(me.createRequestCallback(request, operation, callback, scope), me);
fn.apply(window, args);
},
......
if u look at this code, args never was initialized before the args.push that gives the error.
using a trivial record.save() gives me an error
Ext.onReady(function() {
Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);
Ext.define('someModel', {
extend: 'Ext.data.Model',
fields: ['id','someField'],
proxy:
{ type: 'direct',
api:{ create : carDefaultQuery.carInsert }
}
});
var myRecord = Ext.create('someModel');
myRecord.set('someField','some text');
myRecord.save();
});
error comes from this library code
Ext.define('Ext.data.proxy.Direct', {
..........
doRequest: function(operation, callback, scope) {
var me = this,
writer = me.getWriter(),
request = me.buildRequest(operation, callback, scope),
fn = me.api[request.action] || me.directFn,
params = request.params,
method,
args;
if (!fn) {
Ext.Error.raise('No direct function specified for this proxy');
}
if (operation.allowWrite()) {
request = writer.write(request);
}
if (operation.action == 'read') {
// We need to pass params
method = fn.directCfg.method;
args = method.getArgs(params, me.paramOrder, me.paramsAsHash);
} else {
args.push(request.jsonData); <-- ERROR, args undefined
}
Ext.apply(request, {
args: args,
directFn: fn
});
args.push(me.createRequestCallback(request, operation, callback, scope), me);
fn.apply(window, args);
},
......
if u look at this code, args never was initialized before the args.push that gives the error.