vaadin TreeTable 删除没有子项的父项上的下拉列表
我正在使用 vaadin 的 TreeTable。有没有办法删除或隐藏没有任何子级的第一级对象上的下拉箭头,并且仍然使对象垂直正确定位?
更新
如果有人感兴趣的话最终解决方案:
我将 FieldFactory 添加到表中
protected class TableFactory extends DefaultFieldFactory{
private static final long serialVersionUID = 1L;
private MyTreeTable table;
public TableFactory(MyTreeTable table){
this.table = table;
}
@Override
public Field createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
Field field = super.createField(container, itemId, propertyId, uiContext);
if(itemId instanceof TaskHeadRow){
if(((TaskHeadRow)itemId).getTask() instanceof SystemTask){
table.setChildrenAllowed(itemId, false);
}
}
return field;
}
}
I'm using vaadin's TreeTable. Is there a way to remove or hide the dropdown arrow on the first level objects that do not have any children and still have the objects correctly positioned vertically?
UPDATE
Final solution if anyone is interested:
I add a FieldFactory to the table
protected class TableFactory extends DefaultFieldFactory{
private static final long serialVersionUID = 1L;
private MyTreeTable table;
public TableFactory(MyTreeTable table){
this.table = table;
}
@Override
public Field createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
Field field = super.createField(container, itemId, propertyId, uiContext);
if(itemId instanceof TaskHeadRow){
if(((TaskHeadRow)itemId).getTask() instanceof SystemTask){
table.setChildrenAllowed(itemId, false);
}
}
return field;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您为该项目定义,则不会显示箭头:
The arrow is not show if you define for the item: