adopted-ember-addons / adopted-ember-addons/ember-infinity

Serverside filtering

未关闭
#327 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
374
派生
128
PR 合并指标
30 天内没有已合并 PR

描述

Hi,
this is somewhat related to #156.
Ember is v3.4.2 and ember-infinity is v1.2.3.

I am loading markers on a map.
First all markers are loaded with the infinity-loader component in view.
=> All pages are loaded and `reachedInifinity` becomes `true`.
Then a new request is made to the server and the old model is replaced with the new one.
=> Now only the first page is loaded though. `reachedInifinity` has value `false`, but the infinity-loader component does not reappear as it did when not filtering.

It works beautifully if the old model is replaced with the new one _before_ the old models `reachedInifinity` becomes `true`.

Do I have to reset something manually, or do I go about this the wrong way?

I also found that the infinity-loader component has the `reached-infinity` class set although `reachedInifinity` has value `false`.
```


Infinite Model Entirely Loaded.

```
I am currently resetting the model like this
```
makeInfinityRemoteCall() {
this.infinity.model('artist', this.queryOptions, InfinityModel.extend({ app: this.get('app') }))
.then((artists) => this.set('controller.model.artists', artists));
}
```

I already tried using the `replace()` service method, but that seems not to replace the model at all (and yields no error).
```
makeInfinityRemoteCall() {
this.infinity.model('artist', this.queryOptions, InfinityModel.extend({ app: this.get('app') }))
.then((artists) => this.get('infinity').replace(this.get('controller.model.artists'), artists));
}
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。