PDA

View Full Version : Datefield's format changed itself



omegafox
25 Apr 2008, 7:24 AM
I am so puzzled about this part. If I leave the datefield (click outside of datefield) and it just format
For example, I picked 2/22/2008 and I clicked outside of the datefield, it changed to 08/22/1910 itself.
I am taking wild guess that datefield is still editing mode. But I am not sure how to stop it.

can you least tell me how to stop change itsself?



function addRes(oldHoliday,newDesc){
if(!win){
function renderDate(value){
return value ? value.dateFormat('m/d/Y') : '';
};

var simple = new Ext.FormPanel({
frame:true,

bodyStyle:'padding:5px 5px 0',
labelWidth: 68,
onSubmit: Ext.emptyFn,
submit: function() {
simple.getForm().getEl().dom.submit();
},
items: [{
layout: 'table',
xtype:'datefield',
fieldLabel: 'Holiday',
name: 'dtholiday',
width:300,
id:'holidayName',
//format: 'm/d/Y',
value: oldHoliday,
renderer: renderDate,
allowBlank:false
}, {
xtype:'textarea',
fieldLabel: 'Holiday Description',
name: 'description',
id:'holidayDesc',
height:100,
width:300,
maxLength :255,
value: newDesc,
allowBlank:false }
],
buttons:[{
text:'Submit',
formBind: true,
handler:function(){
simple.getForm().submit
{
}
})
win.hide();
win.destroy();
win = undefined;
ds.reload();
}

}
},
{
text: 'Cancel',
handler: function(){
win.hide();
win.destroy();
win = undefined;
}

}]
});//end of formpanel

win = new Ext.Window({
title: 'New Holiday',
width:500,
height:250,
closeAction:'hide',
layout: 'fit',
closable:false,
autoDestroy:true,
items: [simple]

});
}
simple.startMonitoring();
win.show(this);
};