I'm trying to wrap my head on using TreeView with options set to checkChildren=false and checkboxes.checkChildren=true. See the attached code, for simplicity it is derived from the TreeView / Checkboxes demo. Actual program has a larger tree all loaded at startup, and one day it may be loaded progressively.
1) Setting loadOnDemand=false, checking the non-expanded root the children are not seen by the checkedNodeIds().
2) Visiting the tree with the visitHDS(...) (Visit Tree button) function once the hierarchical datasource is bound to the tree changes the behaviour and checkedNodeIds() reports all checked children.
3) The "Change Template" button trigers template change function ( $("#change").click(function() { ...} ) tha uses treeView.setOptions(...). To force the update the tree treeView.setDataSource(...) method is used.
Some questions/observations:
a) Is it the intended behaviour?
b) Setting loadOnDemand=false makes the template change faster, also, in the future the tree may be loaded lazily from server.
c) Should I use an alternative function to checkedNodeIds?
d) Why visitHDS(...) "fixes things up? Why it works only after the hierarchical datasource is used by a tree.
e) Is there a better method for rerendering the tree after the template change than treeView.setDataSource? (tried treeView.dataSource.read() but it is not faster and quite distruptive.
1) Setting loadOnDemand=false, checking the non-expanded root the children are not seen by the checkedNodeIds().
2) Visiting the tree with the visitHDS(...) (Visit Tree button) function once the hierarchical datasource is bound to the tree changes the behaviour and checkedNodeIds() reports all checked children.
3) The "Change Template" button trigers template change function ( $("#change").click(function() { ...} ) tha uses treeView.setOptions(...). To force the update the tree treeView.setDataSource(...) method is used.
Some questions/observations:
a) Is it the intended behaviour?
b) Setting loadOnDemand=false makes the template change faster, also, in the future the tree may be loaded lazily from server.
c) Should I use an alternative function to checkedNodeIds?
d) Why visitHDS(...) "fixes things up? Why it works only after the hierarchical datasource is used by a tree.
e) Is there a better method for rerendering the tree after the template change than treeView.setDataSource? (tried treeView.dataSource.read() but it is not faster and quite distruptive.