-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
view model and view not syncing #9
Comments
Hello Robin, v-dragable-for diretive works when binding with array but not with objects. In you case you can transform your questiongroups object into an array and it will work:. Here is a workling example: https://jsfiddle.net/dede89/t81zfo98/ |
how do i transform my questiongroups object into an array? i see, it works as an array. |
You can take a look at here: http://stackoverflow.com/questions/6857468/converting-a-js-object-to-an-array |
thanks. is there a way in vueJS to set data to an array instead of an object? I use
|
I found a way:
|
Better to receive directly the data as array from the backend! |
Documentation updated. |
Hi David,
i have a problem with the syncing to the model. I tested v-dragable-for with
which works fine. It is a Array of objects. Now my Model is not a Array of objects. It is a Object of Objects.
Then the syncing to the view doesn't work. Here is how i get my Questiongroups:
The result is a Object with the name 'questiongroups'. Here is a Screenshot
now there is an empty questions-array in each questiongroup-object. I have a method where i create and save new questions to a questiongroup. After the saveAction is done the questiongroups-object looks like:
So now its Object(questiongroups) > Object(questiongroup) > Object(questions) > Object(question)
I want to reorder the Questions so that every key = "question_order" (marked red) gets the new $index. This doesnt work. The $index is not changing after draging/sorting the list.
So thats for the beginning. I will provide a jsfiddle as soon as possible :-)
edit: here is the promised jsfiddle
https://jsfiddle.net/38a9sq4t/
best regards,
Robin
The text was updated successfully, but these errors were encountered: