You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// controller.jsexportdefaultController.extend({actions: {createNewPost(){// Note that this by itself won't make the post appear in paginated list of postsletnewPost=this.store.createRecord('post');// Not even saving the data server side will make it appear on user's screenreturnnewPost.save().then(()=>{// This will force the ember-cli-pagination to re-fetch current pagethis.get('model').setOtherParam('nameOrValueOfThisPropertyDoesNotReallyMatter',true);});}}});
{{! template.hbs }}
<button{{action"createNewPost"}}>Click me to create new post</button>
<ul>
{{#eachmodelas |post|}}
<li>{{post.id}}</li>
{{/each}}
</ul>
Not: I'm writing that from the top of my head. Might not 100% compile.
Hope this might help somebody. Also if this snippet is correct, it would be nice to have it as part of the documentation.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
I'm completely missing a hint that would describe how to handle the case when user adds new data into currently paginated data set. My case would be:
I think I found a nice solution which is unfortunately not documented anywhere:
Not: I'm writing that from the top of my head. Might not 100% compile.
Hope this might help somebody. Also if this snippet is correct, it would be nice to have it as part of the documentation.
The text was updated successfully, but these errors were encountered: