View Full Version : Notes Datefield DisabledDays
flyingman
28 Sep 2009, 6:20 AM
I have in a Notes Form a Datefield. When i will disable Days with the following Code:
var dt = new Ext.form.DateField({
name: 'AN_DTDatum',
width: 110,
allowBlank: false,
disabledDays : [1,2,3,4,5,6],
applyTo : 'AN_DTDatum' //id in field name
}); is the result 2 Datepicker. Why?
Thanks
Roland
mfariborz
28 Sep 2009, 10:49 AM
Hello Roland,
I believe this will work for you if you set the Class for your Date / Time field to xnd-ignore. That will keep Ext.nd from doing it's default formatting on the field, then your code can do the formatting you need.
Hope that helps,
Mike
jratcliff
28 Sep 2009, 2:18 PM
Yep, Mike is correct. If you have Ext.nd converting your fields but want to do something special to a field then add "xnd-ignore" as a css class to this field and our code will ignore it.
flyingman
28 Oct 2009, 8:32 AM
Now I set the class of 'xnd-ignore' and the config is:
var df5 = new Ext.form.DateField({
width: 90,
name: 'AN_DTAnmeldeschluss',
allowBlank: false,
blankText: 'Bitte tragen Sie eine Datum ein.',
disabledDays : [6,0],
minValue: minDt,
applyTo: 'AN_DTAnmeldeschluss'
});
On save all the 'xnd-ignore'-Fields are not validate of blankText. Where can I validate this fields?
Thanks
Roland
mfariborz
28 Oct 2009, 10:06 AM
Haven't tried this yet, but perhaps you need to set msgTarget and invalidClass? Perhaps msgTarget: 'qtip' and invalidClass: 'x-form-invalid'?
From the Ext documentation, I would have thought the Date fields would have reacted just like the rest of the fields.
Anyway, it's worth a shot. Hope that works out for you.
Mike
flyingman
29 Oct 2009, 3:54 AM
thanks, but it does not work.
another problem with 'xnd-ignore':
uidoc.getForm().findField('AN_DTAnmeldeschluss')
firebug: 'uidoc.getForm().findField("AN_DTAnmeldeschluss") is null'
when the class is set to 'xnd-ignore', without this class it works.
Roland
mfariborz
4 Nov 2009, 7:21 AM
Hi Roland,
Try adding the following at the end of your Ext.onReady() method.
//var frm = new Ext.nd.Form appears at the beginning of the Ext.onReady method.
//If you are using Ext.nd.UIDocument instead, it would be that variable.
frm.getForm().items.add(df5);
That should fix the problem with uidoc.getForm().findField("AN_DTAnmeldeschluss") returning null.
As for the other issues, could you post all of your code? That will help me in trying to recreate it here.
Thanks,
Mike
flyingman
17 Nov 2009, 3:03 AM
This works (without 'xnd-ignore'):
var df5 = uidoc.getForm().findField('AN_DTAnmeldeschluss');
df5.allowBlank = false;
df5.blankText = 'Bitte tragen Sie eine Datum ein.';
df5.disabledDays = [6,0];
df5.minValue = minDt;
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.