GWT DataGrid multi row header

柔情痞子 提交于 2020-01-05 09:04:05

问题


I am migrating some GWT content from CellTable to DataGrid, mainly for the DataGrid's feature of locking the header row in place as you scroll.

With CellTable, the column header text would wrap to the next line if the text phrase was too long. The CellTable's header would dynamically grow in height. This was the default behavior, and I never edited any css files.

Can I get this behavior in DataGrid? Do I need a change to my main project css file, or do I make a change to clean.css? Is there a programatic way to set a proprety on DataGrid?

I am creating TextColumn, etc. and adding via dataGrid.addColumn();

Edit: looking at the example here, the header doesn't wrap if you shrink the width of your browser window: http://gwt.googleusercontent.com/samples/Showcase/Showcase.html#!CwDataGrid


回答1:


Add this to your CSS file:

th {
    white-space: normal !important;
}


来源:https://stackoverflow.com/questions/14840997/gwt-datagrid-multi-row-header

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