TreeGrid - add icons to "level-spacer" span depending on grid data

Hello, I would like to add some icons to the “level-spacer” of the TreeGrid hierarchy column (see attached image) depending on the data of the item in that cell, which means the icons could be different for every row. Is it possible?

Regards, Nemanja

Has nobody done this before?

How about doing this by changing the column renderer of the following column to also include such an icon?

grid.addComponentColumn(item -> {
	Icon icon = findIconDependingOnItemData(item); // TODO
	String name = item.getName();
	return new HorizontalLayout(icon, name);

Hmm…im not 100% sure what you mean, I’m guessing you’re talking about making the hierarchy column (the one with names) a component column and adding an icon there? But my goal is to add icons only to LEAF items (items without children aka the last items in treegrid), and the reason behind putting the icons in the “level-spacer” is, so that a user can see the icons without scrolling to the right (in case I would put the icons in a new column at the end) and it would look nicer, since it would use up all the unused space that the “level-spacer” span holds.