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

霸气de小男生 提交于 2019-12-04 14:50:43

In my project I do that:

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

.edit-cell input {
    width: 290px;
}

Finally the answer ! I tried this even simplier using UIBinder by adding :

.edit-cell input {
    width: 30px;
    text-align: right;
}

Then for the cell table I added

 <c:CellTable
        addStyleNames='{style.edit-cell}'
        ui:field='itemTable' />

Wonderful !

Chris Phillipson

You'll need to create a custom component. The out of the box EditTextCell does not allow you to set the size attribute of the input field, just the column width.

Have a look at the ValidateableInputCell impl here: In search of a GWT validation example... where art thou? for an example of how to craft a custom cell.

Admittedly the validation does not yet work but the ability to set the size on the input field within the cell does.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!