-
11 Sep 2009 4:35 AM #1
How to change textfield color in DateField
How to change textfield color in DateField
Hello,
I am using datefield and I need to change a color(and border) of textfield. I am trying use a style, but it doesen't work. DatePicker is in Layout Container.
and CSSCode:DateField data = new DateField(); data.setWidth(150); data.setFormatValue(true); data.getPropertyEditor().setFormat(DateTimeFormat.getFormat("dd MMMM y")); data.setValue(new Date()); data.setStylePrimaryName("userDatePickerClear");
In firebug I don't see that datepicker use this style, but when I add style to layout containter its take effects. I am must change color only textfield (datepicker must be untouched).Code:.userDatePickerClear{ background-color: none !important; background-image: none !important; background-color: red !important; }
-
14 Sep 2009 7:18 AM #2
better use:
and this cssPHP Code:data.addStyleName("userDatePickerClear");
PHP Code:.userDatePickerClear .x-form-text {
background-image: none !important;
background-color: red !important;
}
This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.
GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041
-
29 Sep 2009 12:46 PM #3
Thanks for answer, I need something like datepicker+label (not edit). I try to write own component but I found another problem (i will create another thread - all problem must by solved
). Fastest way to have this functionality is change existing datepicker.
I add some button (+some lines of code). Only what i need now is to
-align text in edit to right
-disable validation checking (I use some special formatting in edit and warning about error is shoving on my additional button).
-
30 Sep 2009 6:01 AM #4
the idea was to point you not using the GWT setStylePrimaryName but the GXT addStyleName. and not the setStyleName but the addStyleName ... and refine the item you will style.
did my suggestion works?
ah ok - that was not the question in your first part ;-) maybe you just only hide the editfield with css?
so you need a datepicker but with a hidden textfield? or im wrong.
maybe you have a example picture how it should looks like.
you can do this with a custom css style.
you can use a custom renderer to check the formatting or just return true ...This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.
GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041


Reply With Quote