Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to configure treeview with an options argument #13

Open
Goswinus opened this issue Aug 30, 2019 · 1 comment
Open

Unable to configure treeview with an options argument #13

Goswinus opened this issue Aug 30, 2019 · 1 comment

Comments

@Goswinus
Copy link

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"

@hummingbird-dev
Copy link
Owner

hummingbird-dev commented Aug 31, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants