Vaadin tree onclick扩展

时间:2013-05-31 10:27:34

标签: vaadin

我是Vaadin的新手,我想知道如何在点击时展开树节点?更确切地说,当我点击父节点而不是展开按钮时,我希望树展开。

4 个答案:

答案 0 :(得分:2)

答案 1 :(得分:1)

例如,如果要扩展vaadin.ui.Tree中的所有节点:

// --- Expand all nodes
for (Iterator<?> it = tree.rootItemIds().iterator(); it.hasNext();) {
    tree.expandItemsRecursively(it.next());
}

答案 2 :(得分:0)

这对我有用:

@Override
        public void itemClick(ItemClickEvent itemClickEvent) {
            final String column = itemClickEvent.getPropertyId().toString();
            final String item = (String) itemClickEvent.getItemId();
            if (column.equals(something)) {
                Boolean collapsed = functieTree.isCollapsed(item);
                LOGGER.debug("COLLAPSED: " + collapsed);
                tableTree.setCollapsed(item, !collapsed);
            }
        }

答案 3 :(得分:0)

const FlexSize= (props)=>{
  return (
    <View style={styles.container}>
      <View style={{flex: 0.1}}>
        <Box style={{flex: 0.7}}/>
        <Box style={{backgroundColor:'yellow'}}/>
        <Box/>
        <Box style={{flex: 0.3, backgroundColor:'yellow'}}/>
      </View>
      <View style={{flex: 0.1}}>
        <Box style={{flex: 0.5}}/>
        <Box style={{backgroundColor:'yellow'}}/>
        <Box/>
        <Box style={{flex: 0.5, backgroundColor:'yellow'}}/>
      </View>
    </View>
  )
}


const styles = StyleSheet.create({
  container: {
    flex:1,
    flexDirection:'row',
    backgroundColor: colors[1],
  },
});

这对我有用