hummingbird-treeview icon indicating copy to clipboard operation
hummingbird-treeview copied to clipboard

Unable to configure treeview with an options argument

Open Goswinus opened this issue 5 years ago • 1 comments

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"

Goswinus avatar Aug 30 '19 14:08 Goswinus

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";

hummingbird-dev avatar Aug 31 '19 05:08 hummingbird-dev