Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT EditTextCell : How to increase editable TextBox width in EditTextCell?

I am using GWT2.3 in my project. I want to increase editableTextBox width when user click on editableTextCell. Problem is My Column width is 200 Px. when user clicks on editableTextCell then that TextBox width is around 125px in EditableTextCell is less as compare to column width.

I added EditTextCell in Celltable's column

Column stringColumn = new Column(new EditTextCell()) { // My Code }

cellTable.addColumn(stringColumn, "MyColumn"); cellTable.setColumnWidth(checkBoxColumn, 200, Unit.PX);

I tried following way to increase TextBox width but problem is I cannot edit in textbox + focus not losses

    @Override
            public void onBrowserEvent(Context context, Element elem,Record object, NativeEvent event) {
                String type = event.getType();

                  int editedTexBoxSize = (cellTable.getOffsetWidth()-100)/cellTable.getColumnCount();

                  if(elem.getInnerHTML().startsWith("<INPUT")){
                      String test = elem.getInnerHTML();
                     // test = <INPUT tabIndex=-1 value=P __eventBits="2048"></INPUT>

                     test= test.replace("value", " size="+editedTexBoxSize+" value");


                    // test = <INPUT tabIndex=-1 size=131 value=P __eventBits="2048"></INPUT>


                      elem.setInnerHTML(test);
                  }
                super.onBrowserEvent(context, elem, object, event);
            }

I want to Increase(set) TextBox width appear in EditTextCell is equal to column Width.

Any Solution ?

like image 579
StackOverFlow Avatar asked Jan 23 '26 10:01

StackOverFlow


1 Answers

In my project I do that:

cellTable.getColumn(cellTable.getColumnIndex(column)).setCellStyleNames(CELL_CSS);

.edit-cell input {
    width: 290px;
}
like image 125
Terence Avatar answered Jan 26 '26 09:01

Terence



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!