trentcioran
19 Nov 2009, 8:36 AM
Hi guys,
I recently started to work with Ext.Direct and it is really great :D, well it was a pleasure until i found a problem, i don't know if it is a bug or i'm doing something worng (wich could be the case but how to know), wel my case is this:
I have a form in which i want to load some data, and i'm using the direct api, here the code
FormBase = Ext.extend(Ext.Window, {
modal: true,
layout: 'fit',
height: 500,
width: 500,
formXtype: null,
initComponent: function() {
Ext.apply(this, {
items: this.form = new Ext.form.FormPanel({
api: this.api,
paramOrder: ['Id'],
layout: 'fit',
frame: false,
border: false,
items: {
xtype: this.formXtype
},
buttons: [{
text: 'Save',
handler: this.onSave,
scope: this
}, {
text: 'Cancel',
handler: function() {
this.close();
},
scope: this
}]
})
});
FormBase.superclass.initComponent.call(this);
this.addEvents('saved');
this.show();
},
onRender: function() {
FormBase.superclass.onRender.apply(this, arguments);
if (!Ext.isEmpty(this.RecordId)) {
this.form.load({
params: {
Id: this.RecordId
}
});
}
}
});
the this.api variable handles the specific api specification for the module, in this case it is
api: {
submit: ManageChildren.SaveForm,
load: ManageChildren.LoadForm,
destroy: ManageChildren.DeleteForm
}
the direct api config is this
Purple.REMOTING_API={ "actions" : {
"ManageChildren" : [ { "len" : 4,
"name" : "GetList"
},
{ "len" : 1,
"name" : "LoadForm"
},
{ "len" : 1,
"name" : "DeleteForm"
},
{ "formHandler" : true,
"len" : 1,
"name" : "SaveForm"
}
]
},
"type" : "remoting",
"url" : "/DirectRouter.ashx"
};
I'm doing this because the form is loaded as a result of a double click event in a grid where i show the child data, but when the form is shown the browser freezes and after a few seconds firefox shows me the error:
too much recursion ext-all-debug.js (lĂnea 11532 [the line varies])
}else if(Ext.isArray(o)){\n
I'm also trying to perform de thelete using the api ManageChildren.DeleteForm(id); with the same too much recursion error result.
Am i doing something wrong?
Thanks
TrentCioran
I recently started to work with Ext.Direct and it is really great :D, well it was a pleasure until i found a problem, i don't know if it is a bug or i'm doing something worng (wich could be the case but how to know), wel my case is this:
I have a form in which i want to load some data, and i'm using the direct api, here the code
FormBase = Ext.extend(Ext.Window, {
modal: true,
layout: 'fit',
height: 500,
width: 500,
formXtype: null,
initComponent: function() {
Ext.apply(this, {
items: this.form = new Ext.form.FormPanel({
api: this.api,
paramOrder: ['Id'],
layout: 'fit',
frame: false,
border: false,
items: {
xtype: this.formXtype
},
buttons: [{
text: 'Save',
handler: this.onSave,
scope: this
}, {
text: 'Cancel',
handler: function() {
this.close();
},
scope: this
}]
})
});
FormBase.superclass.initComponent.call(this);
this.addEvents('saved');
this.show();
},
onRender: function() {
FormBase.superclass.onRender.apply(this, arguments);
if (!Ext.isEmpty(this.RecordId)) {
this.form.load({
params: {
Id: this.RecordId
}
});
}
}
});
the this.api variable handles the specific api specification for the module, in this case it is
api: {
submit: ManageChildren.SaveForm,
load: ManageChildren.LoadForm,
destroy: ManageChildren.DeleteForm
}
the direct api config is this
Purple.REMOTING_API={ "actions" : {
"ManageChildren" : [ { "len" : 4,
"name" : "GetList"
},
{ "len" : 1,
"name" : "LoadForm"
},
{ "len" : 1,
"name" : "DeleteForm"
},
{ "formHandler" : true,
"len" : 1,
"name" : "SaveForm"
}
]
},
"type" : "remoting",
"url" : "/DirectRouter.ashx"
};
I'm doing this because the form is loaded as a result of a double click event in a grid where i show the child data, but when the form is shown the browser freezes and after a few seconds firefox shows me the error:
too much recursion ext-all-debug.js (lĂnea 11532 [the line varies])
}else if(Ext.isArray(o)){\n
I'm also trying to perform de thelete using the api ManageChildren.DeleteForm(id); with the same too much recursion error result.
Am i doing something wrong?
Thanks
TrentCioran