Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save branflake2267/7da92d23ddffeb5ac8beb6b94978bd8a to your computer and use it in GitHub Desktop.
Save branflake2267/7da92d23ddffeb5ac8beb6b94978bd8a to your computer and use it in GitHub Desktop.
GXT 4 resizable text area in a flex table.
@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;
}
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);
}
}
@branflake2267
Copy link
Author

screen shot 2017-05-01 at 12 55 36 pm

screen shot 2017-05-01 at 12 55 43 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment