patternfly / patternfly-bootstrap-treeview

Tree View for Twitter Bootstrap -
http://jonmiles.github.io/bootstrap-treeview
Apache License 2.0
200 stars 105 forks source link

removeNode with silent: true still fires treeview rendered event #102

Open keithabramo opened 5 years ago

keithabramo commented 5 years ago

When calling removeNode with the silent: true modifier set, the method still triggers the treeview rendered event.

Steps to reproduce:

1) make a call like .treeview("removeNode", [nodesToRemove, { silent: true }]); 2) Observe treeview's "rendered" event is called again if nodes were removed.

mwr9uk commented 4 years ago

This has been a problem for me too, since calling removeNode with a null seems to be the only workaround for refreshing the treeview with updated data.

Whilst the function takes an options structure, it doesn't do anything with it. This is not used in the function: `options = $.extend({}, _default.options, options);

I believe it should be passed to _setInitialStates, because within that function, the default options are used to determine whether events are fired.