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

Reject checkbox state change #1123

Closed
lostllama opened this issue May 21, 2015 · 5 comments
Closed

Reject checkbox state change #1123

lostllama opened this issue May 21, 2015 · 5 comments

Comments

@lostllama
Copy link

Hi Ivan,

I've been trying to make checkboxes read only for the purposes of viewing. One Stack Overflow post I found suggested using the types plugin but the checkboxes plugin doesn't seem to support this:

http://stackoverflow.com/questions/20491989/having-a-jstree-with-checkboxes-how-can-i-disable-all-checkboxes

In a previous (similar) issue, you suggested using core.check_callback but this does not seem to be fired for check events.

Do you have any suggestions?

Thanks in advance.

Kind regards,

John

@lostllama
Copy link
Author

P.S. To clarify, I still require the activate_node event so that I can show information about the node. My sole desire is to disable the checkbox.

@vakata
Copy link
Owner

vakata commented May 21, 2015

So you are using tie_selection as false I guess? I will consider adding a config option for disabled checkboxes (the same node the whole node can be disabled).

Best regards,
Ivan

@lostllama
Copy link
Author

Yes, I am using the following options:

'checkbox': {
    whole_node: false,
    tie_selection: false,
},

@vakata vakata closed this as completed in 99d6ac4 May 25, 2015
@vakata
Copy link
Owner

vakata commented May 25, 2015

To use this option you can either set it in the state as a boolean called checkbox_disabled or use the functions enable_checkbox() & disable_checkbox() at runtime.

@lostllama
Copy link
Author

Thank you :) Works beautifully

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