Skip to content
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

Data replication #34

Open
barhaleacct opened this issue Apr 24, 2015 · 6 comments
Open

Data replication #34

barhaleacct opened this issue Apr 24, 2015 · 6 comments

Comments

@barhaleacct
Copy link

Hi
If you have the select with a list of items. If you make any dynamic changes to the page and reload the data, so the changes show on page, the items in the dropdown become replicated.
Everytime you make a save, you update the data, angular refreshes it's variables so the user has up to date info and it still replicates in the dropdown.
I've tried destroying the the array. emptying the array, everything. I can see angular is emptying it from the console, the data gets trashed and then is reloaded once. . but the dropdown is keeping a copy and just adding to it. It is rather frustrating.

@john-oc
Copy link
Owner

john-oc commented May 21, 2015

@barhaleacct
Sorry for the late response. I'll look into this and tyr to get it fixed.
John

@SaJeTek-Developer
Copy link

Any update on this? Same problem occurring to current date. My list keeps extending even if i recreate it.

@john-oc
Copy link
Owner

john-oc commented Dec 3, 2015

Hi,
Apologies. I wasn't able to reproduce this issue myself. Any chance you could set up a Plunker or JSFiddle to show the problem? Or failing that, can you tell me what options you're using, particularly how the data is being provided, what's changing in the page and where the data's being updated?
Thanks,
John

@SaJeTek-Developer
Copy link

Hi thanks for the response. I have as follows:
In my html I have:

image

In the controller.js I have a custom made list as this needs to be one level to access the data.
i.e. [{"id":1, "display":"Hello World"}] vs [{"id":1, "display":{"new":"Hello World!!", "old":"HiWorld"}}]

Periodically when selecting another switch input, "ac_scheduleSelectOptions" switches between all schedules or schedules not yet completed. I have tested that "ac_scheduleSelectOptions" updates to the correct values pulled from the database but it gets duplicated in the dropdown every time the value is updated.
There are 3 schedules in total and 2 incompleted so the list should either be 2 or 3 items.

image

@SaJeTek-Developer
Copy link

I found a fix in the "acute.select.js" file..
This is fixed by adding the following line in the "$scope.loadItems" function:
//ADD THE FOLLOWING LINE TO RESET THE ARRAY
$scope.items = [];

Change:
image

to

image

@john-oc
Copy link
Owner

john-oc commented Dec 3, 2015

OK, I'll test that change and commit if all looks OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants