问题
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