Created
May 1, 2017 19:55
-
-
Save branflake2267/7da92d23ddffeb5ac8beb6b94978bd8a to your computer and use it in GitHub Desktop.
GXT 4 resizable text area in a flex table.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@def TEXT_AREA_WIDTH 150px; | |
.textAreaResizeFix { | |
width: auto !important; | |
min-width: TEXT_AREA_WIDTH; | |
display: inline-block; | |
/*border: 1px solid red;*/ | |
} | |
.textAreaResizeFix div { | |
width: auto !important; | |
min-width: TEXT_AREA_WIDTH; | |
display: inline-block; | |
/*border: 1px solid green;*/ | |
} | |
.textAreaResizeFix textarea { | |
width: TEXT_AREA_WIDTH; | |
margin-bottom: -4px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.gwt.core.client.EntryPoint; | |
import com.google.gwt.core.client.GWT; | |
import com.google.gwt.resources.client.ClientBundle; | |
import com.google.gwt.resources.client.CssResource; | |
import com.google.gwt.user.client.ui.FlexTable; | |
import com.google.gwt.user.client.ui.HTML; | |
import com.google.gwt.user.client.ui.RootPanel; | |
import com.sencha.gxt.cell.core.client.form.TextAreaInputCell.Resizable; | |
import com.sencha.gxt.widget.core.client.form.TextArea; | |
public class TextAreaWithResizeInFlexTable implements EntryPoint { | |
public interface AppResources extends ClientBundle { | |
public static AppResources INSTANCE = GWT.create(AppResources.class); | |
public interface Styles extends CssResource { | |
String textAreaResizeFix(); | |
} | |
@Source({ "styles.gss" }) | |
Styles styles(); | |
} | |
@Override | |
public void onModuleLoad() { | |
AppResources.INSTANCE.styles().ensureInjected(); | |
TextArea textArea = new TextArea(); | |
textArea.setEmptyText("Description"); | |
textArea.setResizable(Resizable.BOTH); | |
textArea.addStyleName(AppResources.INSTANCE.styles().textAreaResizeFix()); | |
FlexTable flexTable = new FlexTable(); | |
flexTable.setWidget(0, 0, new HTML("first")); | |
flexTable.setWidget(0, 1, textArea); | |
flexTable.setWidget(0, 2, new HTML("first")); | |
RootPanel.get().add(flexTable); | |
} | |
} |
Author
branflake2267
commented
May 1, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment