18 Jan 2012 12:14 AM #1
TwinTriggerField change icon
Does anybody know how can I change the icon of the TwinTriggerField?
18 Jan 2012 6:05 AM #2
Create a class in your css. For example:
background-image: url(../images/default/form/image.gif) !important;
} and then call setTriggerStyle method for your trigger field like that: myTwinTriggerField.setTriggerStyle("x-form-trigger-field");
20 Jan 2012 1:45 AM #3
And how about on Gxt 3?
23 Jan 2012 4:33 AM #4
Thanx for the reply..
I wanted to change the to a search icon which was already included in the css..
So i just called setTwinTriggerStyle("x-form-search-trigger")
23 Jan 2012 3:37 PM #5
In response to micgala's question, this is slightly different in GXT 3 to account for the appearance pattern.
If replacing a style, image, or template for every single instance, you'll need to make a new <replace-with> tag in your module to describe what is being replaced, and what it is being replaced with. If it is a one-off, it is probably easier to pass the appearance into the constructor of the field/cell.
In the case of TwinTriggerField, use SpinnerField as a guide for how the styles, images can be replaced. If you want two icons, side by side (SpinnerField makes them over/under), it should just be a matter of a little css and an image or two, all packed into a client bundle and passed to the super constructor.
8 Jan 2013 4:15 PM #6
I made some implementations for GXT3 that could be some help
add to GWT module
<replace-with class="com.rhem.client.widget.MyTwinTriggerFieldDefaultAppearance"> <when-type-is class="com.rhem.client.widget.MyTwinTriggerFieldCell.MyTwinTriggerFieldAppearance" /> </replace-with>
15 Mar 2013 12:25 AM #7