作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Vaadin 中创建了简单的 FilterTable
:
private static final String COL1_PROP = "date";
private static final String COL2_PROP = "name";
private static final String COL3_PROP = "status";
//............
final FilterTable fooTable= new FilterTable();
fooTable.setImmediate(true);
fooTable.setSelectable(true);
fooTable.setWidth("100.0%");
fooTable.setHeight("100.0%");
fooTable.setColumnHeader(COL1_PROP, "Date");
fooTable.setColumnHeader(COL2_PROP, "Name");
fooTable.setColumnHeader(COL3_PROP, "Status");
fooTable.setFilterBarVisible(true); //show filters
fooTable.setFilterFieldVisible(COL1_PROP, false); //hide col1_prop column filter
fooTable.setColumnCollapsingAllowed(true); // allow collapsing
fooTable.setColumnCollapsed(COL3_PROP, true); // collapse col3_prop column
fooTable.setContainerDataSource(container);
fooTable.setColumnExpandRatio(COL1_PROP, 1.0f);
fooTable.setColumnExpandRatio(COL2_PROP, 2.0f);
我的容器是一个SQLConterner
,其查询如下:
SELECT date, name, status FROM foo
我得到的数据没有问题,但是,我想完全隐藏Status
列。更重要的是我想隐藏 Date
列过滤器。正如我所认为的,带有注释的行可以做到这一点。但事实并非如此。我在表中得到了完整的 3 列,并且所有这些列都有可用的过滤器。
出了什么问题?
最佳答案
将注释行移至 setContainerDataSource 调用下方。
关于java - Vaadin 中的 FilterTable 和 SQLcontainer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31311567/
我在 Vaadin 中创建了简单的 FilterTable: private static final String COL1_PROP = "date"; private stati
我是一名优秀的程序员,十分优秀!