PDA

View Full Version : Please... how do I override Ext.Date strict field. Should be easy.



marsha
10 Mar 2014, 8:10 PM
How do I override the Ext.Date.useStrict to be true. I have tried everything I can think of and nothing seems to work... apply, override, just setting it... nothing. Sample please? ExtJS 4.0.7 / IE 8

None of these work:



Ext.Date.useString = true; //causes bug in 'anonymous' code, whatever that is

Date.useString = true;


Ext.apply('Ext.Date',({
useStrict: true
});


Ext.Date.override({
useStrict: true
}); //not supported


Ext.override(Ext.form.DateField, {
useStrict: true
});

Ext.override(Ext.form.DateField, {
strict: true
}); //simply ignores these




I give up... so frustrating. Thanks in advance for any help you can give.

droessner
11 Mar 2014, 4:32 AM
Ext.define('Overrides.form.field.Date', {
override: 'Ext.form.field.Date',
useStrict: true
});

marsha
11 Mar 2014, 10:25 AM
Thank you very much. That didn't work either but I do appreciate your response and it gives me yet another way to code.

Maybe the problem is IE8... I can't use Fiddle in this version of IE either, and I can use Fiddle in other browsers.

droessner
11 Mar 2014, 10:49 AM
Sorry, I was testing with 4.2.1. I just checked again and just adding the following worked for me under 4.0.7.



Ext.Date.useStrict = true;

chamacs
11 Mar 2014, 10:50 AM
Is the posted code a typo in the post only and not in your test of it? (i.e. 'useString' instead of 'useStrict')


Ext.Date.useString = true; //causes bug in 'anonymous' code, whatever that is

marsha
12 Mar 2014, 4:51 PM
Yes, sorry, that's just a typo. I also tried useStrict and it doesn't work either.

droessner
12 Mar 2014, 6:58 PM
Here's a working example:

48a

marsha
12 Mar 2014, 11:05 PM
Thank you. I'm considering this ANSWERED because I put "Ext.Date.useStrict = true;" in a couple of browsers and it worked perfectly. For some reason I have problems with IE8, or maybe my copy is corrupt.

Thanks!