Arno.Nyhm
12 Nov 2009, 12:50 AM
if you have a button but need to display it as a normal link:
17155
usage:
Button button1 = new Button("Search 1", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
// do something
}
});
Button button2 = new Button("Search 2", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
// do something
}
});
// style the second button as a link:
button2.addStyleName("button-link");
you need to add this css:
.button-link .x-btn-text {
cursor: pointer !important;
cursor: hand !important;
border: none !important;
/* Disable the button-style */
background-color: transparent !important;
background:none !important;
background-image:none !important;
padding: 0px !important;
color: #4784C3 !important;
text-decoration: underline !important;
}
/* remove images */
.button-link .x-btn-tl,
.button-link .x-btn-tr,
.button-link .x-btn-tc,
.button-link .x-btn-ml,
.button-link .x-btn-mr,
.button-link .x-btn-mc,
.button-link .x-btn-bl,
.button-link .x-btn-br,
.button-link .x-btn-bc {
background-image: none !important;
}
/* remove little dots in FF */
.button-link .x-btn-tl i,
.button-link .x-btn-tr i,
.button-link .x-btn-tc i,
.button-link .x-btn-ml i,
.button-link .x-btn-mr i,
.button-link .x-btn-mc i,
.button-link .x-btn-bl i,
.button-link .x-btn-br i,
.button-link .x-btn-bc i {
font-size: 0px;
}
PS: if you have a better css then can you post this here?
Ref: this is a copy from this posting: http://www.extjs.com/forum/showthread.php?p=378038#post378038
17155
usage:
Button button1 = new Button("Search 1", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
// do something
}
});
Button button2 = new Button("Search 2", new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
// do something
}
});
// style the second button as a link:
button2.addStyleName("button-link");
you need to add this css:
.button-link .x-btn-text {
cursor: pointer !important;
cursor: hand !important;
border: none !important;
/* Disable the button-style */
background-color: transparent !important;
background:none !important;
background-image:none !important;
padding: 0px !important;
color: #4784C3 !important;
text-decoration: underline !important;
}
/* remove images */
.button-link .x-btn-tl,
.button-link .x-btn-tr,
.button-link .x-btn-tc,
.button-link .x-btn-ml,
.button-link .x-btn-mr,
.button-link .x-btn-mc,
.button-link .x-btn-bl,
.button-link .x-btn-br,
.button-link .x-btn-bc {
background-image: none !important;
}
/* remove little dots in FF */
.button-link .x-btn-tl i,
.button-link .x-btn-tr i,
.button-link .x-btn-tc i,
.button-link .x-btn-ml i,
.button-link .x-btn-mr i,
.button-link .x-btn-mc i,
.button-link .x-btn-bl i,
.button-link .x-btn-br i,
.button-link .x-btn-bc i {
font-size: 0px;
}
PS: if you have a better css then can you post this here?
Ref: this is a copy from this posting: http://www.extjs.com/forum/showthread.php?p=378038#post378038