Change Tree item CSS with Javascript


I am using ItemStyleGenerator to determine the style for my tree items. The thing is I cannot use requestRepaint() every time something changes in the tree (the tree is huge) so I thought of modifying item’s CSS using JavaScipt. Is it possible? I know there is an executeJavaScript() method but I have the tree in a PopupView and don’t know how to use it there. Or maybe there is another way the change item’s style without reloading the whole tree?