PDA

View Full Version : Error in "examples/desktop" when the form is submitted



test124578
25 Nov 2010, 5:51 AM
Hello, need your help.
Now apart from the example "Desktop". When you add a standard Windows FORM with a Submit button, when clicked, an error occurs.

sample:

MyDesktop.BogusModule = Ext.extend(Ext.app.Module, {
init : function(){
this.launcher = {
text: 'Window '+(++windowIndex),
iconCls:'bogus',
handler : this.createWindow,
scope: this,
windowId:windowIndex
}
},

createWindow : function(src){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('bogus'+src.windowId);

var pictUploadForm = new Ext.FormPanel({
frame: true,
title: 'HI',
bodyStyle: 'padding:5px',
width: 420,
layout: 'column',
method: 'POST',
fileUpload: true,
items: [
{
xtype: 'textfield',
fieldLabel: 'NEW',
labelSeparator: '',
name: 'currphoto',
id:'ccurrphoto',
anchor:'100%'
}
],
buttons: [
{
text: 'Upload',
handler: function() {
var theForm = pictUploadForm.getForm();

theForm.submit({
url: 'index.php',
success: function(fp, o){
msg('Success', 'Processed file "'+o.result.file+'" on the server');
},
waitMsg: 'Wait...'
})
}
},
{
text: 'Exit'
}
]
});


var window = new Ext.Window({
title: 'Edit photo',
width: 500,
height:250,
layout: 'fit',
modal: true,
plain:true,
bodyStyle:'padding:5px;',
buttonAlign:'center',
items: pictUploadForm,
});

window.show();

}
});

error:


Error: syntax error
Source: http://xxxx/ext-3.3.0/ext-all-debug.js
Line 4233, character 1
Source code:
()

from file ext-all-debug.js:

....
doDecode = function (json) {
---> return eval ("(" + json + ")");
}
....

Condor
25 Nov 2010, 6:20 AM
The response from index.php is invalid (look at the API docs for Ext.form.BasicForm to see what your server should be returning).

test124578
25 Nov 2010, 6:23 AM
Thanks, I was not attentive.
You can close the topic