View Full Version : TwinTriggerField change icon
18 Jan 2012, 12:14 AM
Does anybody know how can I change the icon of the TwinTriggerField?
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
And how about on Gxt 3?
23 Jan 2012, 4:33 AM
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
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
I made some implementations for GXT3 that could be some help
add to GWT module
<when-type-is class="com.rhem.client.widget.MyTwinTriggerFieldCell.MyTwinTriggerFieldAppearance" />
15 Mar 2013, 12:25 AM
Take a look at this post re how to extend a TriggerField:
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.