0
votes

I'm working with Emberjs. I want to refresh data of User route on change a select box value from application controller. On change value of select box just changing the params value not the roue. Ember does not refresh the model data based on new params.

onOrganizationChange:function(){
    var url="/users?org=" + this.selectedOrg;
    this.transitionToRoute(url);
}.observes('selectedOrg')

this function is called every time when user change the company from select box in application handelbar.

And my route map is

App.Router.map(function(){
this.resource("users", function(){
    this.resource("user", {path:"/:user_id"});
    this.route("add", {path:"/add"});
});});
1

1 Answers

4
votes

There is an option to refresh model in Route#queryParams. For example,

queryParams: {
  org: {
    refreshModel: true
  }
},

jsbin that illustrates the problem (without refreshModel) : http://jsbin.com/pinoco/1

Have a look into OPTING INTO A FULL TRANSITION section of http://emberjs.com/guides/routing/query-params/

Working bin : http://jsbin.com/norih/1