hummingbird-treeview
hummingbird-treeview copied to clipboard
Unable to configure treeview with an options argument
I have two treeviews on a single page and want 1 with and 1 without checkboxes.
When I call $('#treeview').hummigbird({checkboxes: 'disabled'}) the function does not process the passed options at all.
This is caused by the following check (on line 167 of hummingbird-treeview.js):
typeof(methodName) == "undefined"
As a result of this check, the passed object is completely ignored. A possible workaround is changing the default options before and/or after the function call, but that's a little crude.
One of the solutions to fix this issue is to change that line to
typeof(methodName) !== "string"
Options cannot be set this way. Please check the README. Options have to be passed before the initialization like this:
$.fn.hummingbird.defaults.option=value;
In your case you have to use:
$.fn.hummingbird.defaults.checkboxes= "disabled";