Giter Club home page Giter Club logo

Comments (10)

arenoir avatar arenoir commented on September 28, 2024

So this issue is not happing on tear down it is happening when ember data saves a object with associations. For instance I have a Task that belongs to a Person. Using this component you can choose the Person.

When saving the Task ember data removes and then re adds the person. ember-cli-selectize then decides that the person is not in the list and sets the person attribute to null using the following callback _onItemRemove

from ember-cli-selectize.

miguelcobain avatar miguelcobain commented on September 28, 2024

This is strange. I'm using this component with Ember Data and didn't have any problems.

Please tell us some more info, like the template you're using, etc.

When saving the Task ember data removes and then re adds the person.

This part makes me confused. Is it because your backend isn't returning the association?
Is the person really associated after save or is it null?

from ember-cli-selectize.

arenoir avatar arenoir commented on September 28, 2024

@miguelcobain yes when saving the Task the server responds with the associations side loaded. I am not sure what the template is.

from ember-cli-selectize.

RuslanZavacky avatar RuslanZavacky commented on September 28, 2024

@arenoir I was experiencing the same issues, but my problem was, that I've specified value & selection to the property:

value=value
selection=value

and it caused random results )

from ember-cli-selectize.

marcemira avatar marcemira commented on September 28, 2024

Hey! Having the same issue here... I have a CRUD for a model. First time the page renders, everything works awesome as expected, then I go back to index and the back to the same route and BAM, my selections (model.myProperty) became null :/

Any idea?

from ember-cli-selectize.

miguelcobain avatar miguelcobain commented on September 28, 2024

Please give us some details like the template you're using. It's working fine here.

from ember-cli-selectize.

miguelcobain avatar miguelcobain commented on September 28, 2024

I have this issue when the following happens:

  1. Set content and selection
  2. Set content to [] (ember-data does this by some reason)
  3. selection becomes null
  4. Set content to some non-empty array
  5. selection is still null

This is due to how selectize works. Basically the possible options become non-existing, and selectize assumes that the current options was deselected, thus the selection is set to null.

Solutions are welcome.

from ember-cli-selectize.

arenoir avatar arenoir commented on September 28, 2024

@miguelcobain I have transitioned to a DDAU approach. It is not ideal but at least I can prevent the mutation in the select-item action.

I think a completely ember select component is needed. I started a addon its a start and would appreciate your input.

from ember-cli-selectize.

marcemira avatar marcemira commented on September 28, 2024

@arenoir @miguelcobain indeed, Ember 2.x road will be all about DDAU, I think there's a lot of stuff to do on ember-cli-selectize in order to be fully compatible with it (and error free)

from ember-cli-selectize.

miguelcobain avatar miguelcobain commented on September 28, 2024

@arenoir Maybe we should join forces: https://github.com/miguelcobain/ember-select

from ember-cli-selectize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.