# Query Parameter New: "Refreshmodel" without replacing the whole model

**URL:** <https://discuss.emberjs.com/t/query-parameter-new-refreshmodel-without-replacing-the-whole-model/5435>\
**Category:** Uncategorized\
**Created:** [May 27, 2014, 7:10pm UTC](https://discuss.emberjs.com/t/query-parameter-new-refreshmodel-without-replacing-the-whole-model/5435 "2014-05-27T19:10:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![m0c](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/m0c/32/259_2.png) [@m0c](https://discuss.emberjs.com/u/m0c)\
**Post date:** [May 27, 2014, 7:10pm UTC](https://discuss.emberjs.com/t/query-parameter-new-refreshmodel-without-replacing-the-whole-model/5435/1 "2014-05-27T19:10:04Z")

</div>

Hi,

I am playing around with the new query parameters. I use it for some kind of pagination. Since the dataset per “page” is slightly complex I am using refreshModel: true. The problem is that this “replaces” the model in the route instead of adding the new ones. If I paginate from page 1 to page 2 I want to keep the records from Page 1. But I do need to query the backend when paginating to page 2 the first time.

Is this possible with the new query parameters, or do I find a work around?

Best Regards, Marc

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [May 27, 2014, 7:43pm UTC](https://discuss.emberjs.com/t/query-parameter-new-refreshmodel-without-replacing-the-whole-model/5435/2 "2014-05-27T19:43:05Z")

</div>

Ran into a similar problem myself which resulted in me manually calling `model` and consuming the result and appending to an array which was bound to a table.

I can post examples of this workaround if @machty doesn’t chime in.

---

<div class="post-metadata">

**Author:** ![m0c](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/m0c/32/259_2.png) [@m0c](https://discuss.emberjs.com/u/m0c)\
**Post date:** [May 28, 2014, 11:58am UTC](https://discuss.emberjs.com/t/query-parameter-new-refreshmodel-without-replacing-the-whole-model/5435/3 "2014-05-28T11:58:10Z")

</div>

Would be great if you cuold provide your solution, if there is no “official” supported solution for this.

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [May 28, 2014, 10:28pm UTC](https://discuss.emberjs.com/t/query-parameter-new-refreshmodel-without-replacing-the-whole-model/5435/4 "2014-05-28T22:28:03Z")

</div>

Here is the Mixin. It’s experimental is why I was hesitant to post it, and like you said there isn’t an known way to solve this issue. Any feedback on enhancing this would be awesome, but the idea is the state of the table (page/offset) is stored on the controller. Every time model gets called and when the pagination event fires, it will pass in the tableParams object into the model hook.

Since I am not using queryParams, we’re on 1.4, you’ll need to some how adapt this to use queryParams.

> **[export default Ember.Mixin.create({ // the keys that represent a property s...](https://pastebin.com/HU8U2EAC)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
