deitch/jstree-grid — Issue #11: Problem with styles for multiple trees
Author: ChrisRaven
Created: 2011-12-27 12:01:09+00:00
State: open

Hi,
There is a problem when styles are added in __init() function. The problem only exists if someone has more than one tree on a site.

Each time user creates a tree, styles are added again to the header, so it makes DOM unnecessary bigger. This should be done only when first tree is created.

More, when someone wants to have both themeroller styled tree and tree without styles, then it is impossible - styles are overwritten. Probably there will be need for separate classes for styled and unstyled trees, but that leads to more complicated code. If that is the solution, then styles should be added to header only when first styled tree is created and when first unstyled tree is created (or add both styles when first tree is created, if there will be different classes for both cases). But I'm not sure if case with both styled and unstyled tree is worth attention, it's rather rare case.