PDA

View Full Version : -changing proxy URL then loading store does not update grid



JackJohnsonX
19 Feb 2015, 8:24 AM
I have a grid with a store which is loaded when app is launched. I have a form also to which the grid is bound to. Initially, the grid shows all records. The search form allows user to filter records. The initial load and search URLs are different. When search is clicked, I dynamically change the URL configured on the store proxy to the filter URL, pass in the form values as extraParams, and load the store. I see the request is made and a response is returned. However, my grid records dont refresh.

//grid store inside initComponent



this.store = Ext.create("Ext.data.Store",{
fields:["rptid", "text", "value", "date_created", "created_by", "active],
autoLoad:true,
proxy:{
type:"ajax",
url:"./getRpts.html",
reader:{
type:"json",
root:"data"
}
}
});




//handler for form search btn




this.getRPTGrid().getStore().getProxy().url = "./getFilteredReports.html";
this.getRPTGrid().getStore().getProxy().extraParams =
this.getSearchForm().getValues();
this.getRPTGrid().getStore().load();




thats it. I confirm the request is being made to load the store and confirm the response being received in debugger. The JSON response also contains the "data" root so thats not the issue and the fields dont change either. I have done this 10,000 times before but have never experienced this. Anyone have any ideas?


I even compared the Request and Response Headers from both requests and their exactly the same minus the url and params..

grid.getView().refresh() did not work either.

JackJohnsonX
20 Feb 2015, 9:49 AM
I deleted the store from inside initComponent and created a separate store. Inside initComponent I did
this.store = "MyGridStore" and then everything worked fine.

what gives??????? What was wrong with me defining the store inside initComponent??? i do that all the time

blwilliams@accruent.com
5 May 2016, 8:47 AM
I'm also having a problem like this. An explaination would be appreciated.