-
Notifications
You must be signed in to change notification settings - Fork 116
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
How to Update Pager? #89
Comments
Since // in controller
page: 1,
perPage: 10,
pagedContent: pagedArray('model', { pageBinding: 'page', perPageBinding: 'perPage' }),
actions: {
addModel: function () {
var models = this.get('model');
var model = this.store.createRecord('myModel', {
fun: true,
foo: 'bar'
});
model.save()
.then(function () {
// might not be necessary if you got the models via store.find('myModel')
models.addRecord(model);
}, function (error) {
console.error(error);
});
}
} |
I've tried this a few different ways but no joy.
I suspect the pagedArray being remote (in my case) prevents me from adding/remove records to/from it? |
Ok, here is a working example
|
@gte451f which shouldn't be, since there should be a proxy @mharris717 |
Not working for me not matter what. Tried get('models.content').pushObject(model), get('models.content.content').pushObject(model), get('models.content').addRecord(model) and get('models.content.content').addRecord(model) all fail. |
There should definitely be a way to push records to PagedRemoteArray :) |
Did not work for me either. My code: return adapter.ajax(url, 'POST', {
email: email
}).then(function(data) {
var normalized = store.normalize(modelName, data.object);
store.push(normalized); //works with this.store.findAll
}); model(params) {
return this.findPaged('billing/delivery-file',params); //paginated not working push to store
// return this.store.findAll('billing/delivery-file'); (this works)
} |
@vasilakisfil did you got any working solution? |
When using the Remote Paginated API option, I have trouble updating the pager when I've added a new record to the found set.
Put another way, if I just added a record via something like Ember Data, how do I tell the Pager about the new record WITHOUT triggering a full XHR request?
I try adding the record to the store like this...
...and while the record shows up on my Ember inspector, the Pager won't show the record.
The text was updated successfully, but these errors were encountered: