ritesh83 / ember-cli-jstree

ember-cli addon for jstree
http://ritesh83.github.io/ember-cli-jstree/#/static
MIT License
41 stars 48 forks source link

Checkbox Cascade option does not work . #46

Open veegandhi opened 8 years ago

veegandhi commented 8 years ago

When I am sending the config hash from the controller , the cascade option of tree hierarchy selection does not work . However the three_state option works .

Below is code : Controller : checkboxOptions:{ cascade : 'up' }, plugins:'checkbox,wholerow,types'

Template : { {{ember-jstree actionReceiver=jstreeActionReceiver selectedNodes=jstreeSelectedNodes data=data plugins=plugins checkboxOptions=checkboxOptions typesOptions=typesOptions
eventDidSelectNode="selectAccount" eventDidDeselectNode="deselectAccount"
contextMenuReportClicked="contextMenuReportClicked" eventDidBecomeReady="handleTreeDidBecomeReady" }} }

ritesh83 commented 8 years ago

Hi @veegandhi

I'm not able to reproduce this issue. Can you provide an ember-twiddle example?

veegandhi commented 8 years ago

How do I add this addon to twiddle ? @ritesh83

ritesh83 commented 8 years ago

@veegandhi You have to add it to the "addons" section in twiddle.json. Anyways I tried creating a twiddle but its throwing a security error https://ember-twiddle.com/82809a6f7b4570b4de8416260fbb59db

Looks like you'll have a create a test project on github and share it with us.

hadiwina commented 6 years ago

@veegandhi From my experience, this may require you to provide all the essential options in the hash that you're sending as checkboxOptions, not just the cascade: 'up'.

let checkboxOptions = this.get('checkboxOptions');
if (Ember.isPresent(checkboxOptions) && pluginsArray.includes('checkbox')) {
    configObject['checkbox'] = checkboxOptions;
}

@ritesh83 is this a correct assumption? -- Or do you think it's on JSTree's level that it replaces the whole thing? It looks like the other default is gone when we provide only certain option(s).