-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Delete all items and perform a new query #47
Comments
Yeah I've had a couple questions about resetting the list. The way you're doing it is how I recommend doing it - but I'll have a play around with this in the coming week and maybe roll an official solution. Stay tuned! |
@joshuadeanhall - are you using ember data 1.13x by chance? RE: controllers: You can do this from the controller also - but we recommend doing it from the route as controllers are set to be deprecated in ember 2.0+ |
@hhff I am using ember 1.13.4. When doing what I posted above I get the following error after hitting the action that refreshes the model and going hitting the end of the first page (After the reload when it tries to load the next page it fails). The result of a server query (on @model:item:) is immutable. My action looks like this
And my model() looks like
Didn't know about controllers in 2.0 thanks for the advice. |
gotcha. thanks for the info! traveling at the moment and won't have a chance to look into this for a couple weeks. Believe its related to #42 |
FWIW, we don't support 1.13.x of ember or ember data yet, there's a PR up for that at the moment |
Have you considered using a queryParam? They can rerun your model hook for you and flush out your results: http://www.foraker.com/blog/creating-a-better-search-experience-with-ember |
closing this for now - as I believe this is resolved |
I have a list with a search feature. When a user performs a search I need to remove all items from the list and perform a new query to populate the list.
So far the best I have got is an action on the route that looks like
this.set('controller.model', this.infinityModel("items", {
id: params.Uid,
perPage: 25,
startingPage: 1,
filter: 'test'
}))
This deletes the items and does a new query but the scrolling fails. (Also I would prefer to be able to do this on the controller). I couldn't find any documentation on how to reset the list and wasn't sure the best place to ask how to perform this.
The text was updated successfully, but these errors were encountered: