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

Multiple Selectize Sharing Same Selection

Open lxcodes opened this issue 10 years ago • 4 comments

Currently I have three {{ember-selectize}} elements on the page all bound to a single property but from different collections / content. If I selected one option in the first selectize and the another option in the second, should the first be cleared? Currently not happening like that. Do I need to have them all coming from the same content?

lxcodes avatar Feb 27 '15 15:02 lxcodes

Sorry, I didn't understand what you're trying to accomplish. Could you try to be more clear?

miguelcobain avatar Feb 27 '15 16:02 miguelcobain

With below, selectedLocation is set to the correct selection of a US state and then a Mexico state afterwards, but upon selected the Mexican state, the US state is still selected in the first select control.

Maybe a case where selectedLocation isn't actually null so the selection isn't clearing. If I manually set selectedLocation to null with the Ember Inspector, it clears both. Since it's not null, it's trying to find the value in the list upon changes and doesn't know if it should clear existing? Currently working on setting three different properties and combining myself.

{{ember-selectize
    content=usaLocations
    selection=selectedLocation
    optionValuePath="value"
    optionLabelPath="label"
    placeholder=(intl-get "messages.global.selectPrompt")}}
{{ember-selectize
    content=mexicoLocations
    selection=selectedLocation
    optionValuePath="value"
    optionLabelPath="label"
    placeholder=(intl-get "messages.global.selectPrompt")}}
{{ember-selectize
    content=canadaLocations
    selection=selectedLocation
    optionValuePath="value"
    optionLabelPath="label"
    placeholder=(intl-get "messages.global.selectPrompt")}}

lxcodes avatar Feb 27 '15 20:02 lxcodes

Is this solved?

miguelcobain avatar Apr 10 '15 14:04 miguelcobain

Actually, I'm not sure why I closed this @miguelcobain >.< -- Busy busy busy morning. I went to check if it was solved and Ember Inspector isn't showing me controllers below the application. Really odd. Will reopen and check on this more this weekend probably.

lxcodes avatar Apr 10 '15 15:04 lxcodes