I have a table where my column headers are set with the following instruction :
table.setColumnHeader
I wonder how can I create multilevel table headers like on this page?
As of Vaadin 6.7.3, this is currently not possible using the stock Vaadin table component.
There is a Trac issue raised for changing this for Vaadin 7. See https://vaadin.com/forum/-/message_boards/view_message/900369 for more details.
Depending on your requirements, you could hide the table component's header and try to simulate the header (by using a HorizontalLayout, generating your own headers and listening to column resize events); alternatively, you could simply generate your own HTML <table></table> and assign it to a label component.
In Vaadin7 you can set the table header height dynamically by adding following CSS rule to your theme:
.v-table-header-wrap {
height: auto;
}
The only think is that the column separator is not set to 100% of the header row height ...
A look into the TreeTable component may help you :
Vaadin sampler
Regards,
Éric.
To make a header only of a table use setPageLength(0); this will eliminate the table body and show only the header.
Then create another table with a header and your data and combine these 2 in a layout :)
It's a cool trick, be sure to match the ratio's of first header with the second's table header.
Related
I have a Word document and I need to edit specific cells in a header table. I could replace strings, but in this case I need to replace all cell content (and it can vary, so I can not use replacement). I tried this:
dm.WordApp.ActiveDocument.Sections.Item(1).Headers.Item(1).Range.Select; //(accsess header)
dm.WordApp.ActiveDocument.Tables.Item(1).Cell(2,3).select;
but the second command does not access the 2,3 cell of the header table, but the first table in the document body.
Could someone help with this issue? I'm using Delphi 10.2.
Use:
dm.WordApp.ActiveDocument.Sections.Item(1).Headers.Item(1).Range.Tables.Item(1).Cell(2,3).Range
Update #2: It turned out that our project setup was not optimal, which is why I had to manually copy the updated VAADIN folder with the theme to another location. The problem was not caused by vaadin but our project setup.
Thank you #SteffenHarbich and the Vaadin-Devs who helped me find the source of my problem here and in the issue ticket.
I am using Vaadin Framework 8.2.0 and I have a Grid with SelectionMode.MULTI
Because of the multiselection mode an additional column appears with checkboxes to select rows, which is fine!
But: these Checkboxes also have a label with the Text Selects row number XX. This label bothers me very much and I can't find a way to remove them.
In the Demo from Vaadin there are no such labels, so I'm sure that it can be achieved somehow.
Hiding the labels with CSS does not help me here, because the column width stays as if there was a label.
Here is my simplified code:
Grid<MyItem> myGrid = new Grid<MyItem>(MyItem.class);
myGrid.setSelectionMode(Grid.SelectionMode.MULTI);
myGrid.getEditor().setEnabled(true);
myGrid.setColumnReorderingAllowed(true);
//all columns match membervariables of MyItem. I use setColumns in order to control which fields are shown (not all of them are)
myGrid.setColumns(GRID_COLUMNS);
myGrid.getColumn("foo").setHidable(false).setCaption("bar");
// configure each column similarly
myGrid.getColumn("foo").setEditorComponent(new TextField());
// some more setters of editorComponents and editorBindings
// finally, set items.
// binder contains a bean that has many MyItems. binder is of type com.vaadin.data.Binder;
myGrid.setItems(binder.getBean().getMyItems());
See the corresponding ticket on github. Problem was old theme CSS.
Add your theme with
.v-assistive-device-only-label label {
font-size:0;
width: 0px;
}
I am using JQGrid and I want column drag and drop feature for this I enabled set sortable = true option. Now the problem is when I have scrollbar and trying to reorder the last columns by dragging the UI of header is mess up as shown below. When I click on country column this column placed at other end.
I had fixed my issue... Sorry its my bad... I was mess up with some css of other components.
Thank you Oleg for helping me and also for wonderful grid component.
I want to add a summary row on end of my table. Is there a standard function of com.vaadin.ui.Table that I can use?
The Vaadin Table known of headers and footers.
Here is the Documentation for it.
// Set the footers
table.setFooterVisible(true);
table.setColumnFooter("Name", "Average");
table.setColumnFooter("Died At Age", String.valueOf(avgAge));
Generating the content of the footer is your responsibility, so you have to do the sums/average or other calculations.
I am trying to use jqGrid to display tabular data in groups (shown in image below) and having trouble displaying headers for each group (as Hierarchical jqGrid displays columns headers for child grids). I have included how default jqGrid Grouping looks like.
Is there any way to implement this? Also is it possible to display summary in group header row instead of footer?
Thank you
What you want contains too many changes in the standard structure of the grid. I suppose that you want that the "Groups" header and sub-headers "Group Header 1", "Group Header 2", "Group Header 3" should be resizable. It seems me a little too difficult in the implementation.
Probably you should use better subgrids instead of data grouping? If you need hold the width of last columns of subgrids synchronous with the width of last columns of the main grid you can use approach which I described in the answer. You can use resizeStop callback to catch changing of column size and you can call setColWidth method (see the answer for more details) on another grid (on main grid and other opened subgrids).