I have followed your advices.
Implementing an IconProvider in order to provide specific icons instead of overriden the calculateIconStyle()-Method. This works very nice.
Also the renderNode method was overriden to remove the joint icon.
My objective is to let a row show the joint icon when this row is clicked.
So I added a RowClickHandler to the TreeGrid. On such a click event, the node's element's inner HTML is set to show the image. On leaving the row, this inner HTML is reset to show the node without the image.
Here is a code snippet of the code setting the inner html stuff:
The above code is called, when the user clicks a row.
Element jointIconElement = AbstractImagePrototype
nodeHtmlElement.setInnerHTML("<div>" + jointIconElement.getString() + "<span> " + currentlyClickedTaskID + "</span></div>");
The above code is called, when the row is leaved.
Element toRemoveHtmlElement = rowNodeToRemoveIcon.getElement();
toRemoveHtmlElement.setInnerHTML("<div><span>" + taskIDToRemove + "</span></div>");
The problem is the following:
When I click on a row, the icon is shown. Clicking on the icon expands the tree node. So far everything's fine.
Though, when I leave this row and click on it a second time, then nothing happens. I.e. the node is not expanded. Clicking on it the second time means, that the inner html of the node element is set again.
For me it looks like the joint icon looses its clickhandler if it is rendered via setInnerHtml(...) the second time. I cannot explain this in another way.
Does anybode had a similar problem or can give me a hint or an idea what causes this problem and how to solve this??