ember-cli-jstree icon indicating copy to clipboard operation
ember-cli-jstree copied to clipboard

Checkbox Cascade option does not work .

Open veegandhi opened this issue 9 years ago • 4 comments

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

veegandhi avatar Jun 21 '16 00:06 veegandhi

Hi @veegandhi

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

ritesh83 avatar Jun 24 '16 22:06 ritesh83

How do I add this addon to twiddle ? @ritesh83

veegandhi avatar Jun 28 '16 02:06 veegandhi

@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.

ritesh83 avatar Jun 28 '16 18:06 ritesh83

@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).

hadiwina avatar Apr 13 '18 19:04 hadiwina