Good day everyone
I had a task to show details in the tree as shown in the picture

I did it this way
is there no other way to achieve the same result?
I had a task to show details in the tree as shown in the picture
I did it this way
Code:
noticesTree = new TreeGrid() {
@Override
protected Canvas getExpansionComponent(final ListGridRecord record) {
Tree tree = noticesTree.getData();
TreeNode parent = Tree.nodeForRecord(record);
int level = 0;
while((parent = tree.getParent(parent)) != null) {
level++;
};
int indent = JSOHelper.getAttributeAsInt(noticesTree.getConfig(), "indentSize");
noticesTree.setProperty("embeddedComponentIndent", noticesTree.getOpenerIconWidth() + level * indent);
DetailViewer details = (DetailViewer) super.getExpansionComponent(record);
details.setLabelAlign(Alignment.LEFT);
details.setLabelSuffix("");
return details;
}
};
Comment