PDA

View Full Version : pagination store url does not change when i update the read url for my store.



Anthony.Hall
23 May 2012, 8:21 AM
I have some logic that changes the store read url. This is working well but i have 2 issues.

1) when i change the store url. I would like the pager to return to the first page
2) when i change the url for the store. The grid updates but the pagination does not. Here's what i have so far.

I set global variable
var contactUrl = '/contacts/clients';

/* controller */


contactUrl = "/newurl";
var contactStore = this.getContactsStore();
contactStore.load({
url: contactUrl,
scope: this
});

my controller updates the url and grid update correctly. However the pagination still calls '/contacts/clients' and note the new url


/* model */



proxy:{
type:'ajax',
api:{
read: contactUrl
}
}

Anthony.Hall
25 May 2012, 6:33 AM
In my proxy i set the a custom param which a global variable "contactType" that is set at the header of my html page



proxy:{
type:'ajax',
api:{
read: '/Contact/read',
},
extraParams : {
'contactType' : contactType
}
},
this works well, i then update my grid



contactType = "courier";
var contactStore = this.getContactsStore();
contactStore.load({
scope:this,
params:{contactType:contactType}
});
This also works well and the value "courier" is added as a param. My issue is that when i click on the pagination buttons the param does not reflect the new value. "courier"

mitchellsimoens
28 May 2012, 7:55 AM
What framework and version of framework?

Anthony.Hall
28 May 2012, 8:02 AM
I'm using 4.1

I've worked this out. I need to set the setExtraParam like so....

contactStore.proxy.setExtraParam('contactType', contactType);