PDA

View Full Version : DateField.setValue and responseText



mradochonski
26 Jun 2009, 5:26 AM
Hi All,

I have a problem with setting a value of DateField using responseText from Connection. I get a value form a server (using alert) but when I try to use the same value for DateField it does not work. Can anyone help me? Code bellow. Thanks.



Ext.onReady(function(){
Ext.QuickTips.init();

var adminForm = new Ext.FormPanel({
width:300,
url:'',
title:'Configuration',
bodyStyle: 'text-align: left;',
frame:true,
renderTo:'adminForm',
monitorValid:true,
items:[new Ext.form.DateField({
fieldLabel: 'eSignup open',
name: 'eSignupOpen',
id: 'eSignupOpen',
width: 180,
format: 'd/m/Y',
readOnly: true,
listeners: {
render: function(field) {
var conn = new Ext.data.Connection();
conn.request({
url: 'configuration.unda',
method: 'POST',
success: function(response) {
field.setValue(response.responseText);
},
failure: function() {
alert("Error");
}
});
}
}
}),
new Ext.form.DateField({
fieldLabel: 'eSignup close',
name: 'eSignupClose',
id: 'eSignupClose',
width: 180
})]
});

});

mradochonski
26 Jun 2009, 9:29 PM
Problem solved.