PDA

View Full Version : DateField Issue



swiji2000
17 May 2012, 3:35 AM
Hi,
I am using DateField for choosing date.

I am not able to choose post date and future date. Current date (Today) only can choose from Date Field.

If I choose other than current date i am getting script error.

My Code :

{
xtype: 'datefield',
width: 160,
fieldLabel: 'Birth',
id:'birth',
format: 'Y-m-d',
labelAlign: 'right',
labelWidth: 40,
flex: 2,
enableKeyEvents: true,
listeners: {
specialkey: function(field, e){
if (e.getKey() == e.ENTER) {
searchfn();
}
}
}

}


The following error I am getting:

"Stop running this script?
A script on this page is causing IE to run slowly.
If it continuous to run, your computer might become
unresponsive."

Please let me know how to solve this issue ?


Thanks in Advance.

friend
17 May 2012, 3:44 AM
The datefield configuration looks fine. Without seeing any surrounding code, I'm guessing that searchfn() is the culprit.

Try commenting out your listener and see if the field works normally.

swiji2000
17 May 2012, 4:03 AM
initComponent: function() {

var me = this;

Ext.apply(me, {
items: [
{

xtype: 'form',
id:'clientForm',
frame:true,
height: 160,
width: 670,
layout: {
type: 'column'
},
bodyPadding: 10,
title: '',
x: 50,
y: 40,
items: [
{ xtype: 'datefield',
width: 160,
fieldLabel: 'Birth',
id:'birth',
format: 'Y-m-d',
name:'date1',
// value:new Date(),
labelAlign: 'right',
labelWidth: 40
}

........

This is my code.

Note: I commented listener but not working.

Thanks

scottmartin
17 May 2012, 8:03 AM
Try running your app in Firefox using Firebug or Chrome using Developer Tools and see if you find any errors in your console. Using IE to develop/debug is futile.

Scott.

swiji2000
17 May 2012, 7:42 PM
Hi,
I am getting the following error while choosing date other than current date in firefox. In firebug console i didn't get any error.

35381

swiji2000
18 May 2012, 4:47 AM
Hi,

I have restructured all the code.
Now its working fine.

Thanks

scottmartin
18 May 2012, 4:49 AM
I believe you have a problem elsewhere and it has snowballed and landed you here. You may have to dissect your app and find out there the cause is.

Check your call stack.
Do you have a code analyzer to make sure you do not have any bugs in your code .. misplaced comma
Do you have any ajax calls that are timing out

Scott.

scottmartin
18 May 2012, 5:03 AM
Thank you for the update.

Scott.

swiji2000
20 May 2012, 7:55 PM
Thanks Scott.