hello! first post.

I'm attempting a datagrid that updates dynamically. User picks some configuration, a request is sent to the server, the response contains the headers and data, and a new grid is displayed with said headers and data.

This is what I've attempted:

1) user chooses new query --> set new baseparams on the store
2) update store fields --> store.reader.meta.fields = NewFields();
3) create new columns --> colModel = new Ext.grid.ColumnModel(NewColumnModel());
4) grid.reconfigure(store, colModel);

this almost all works. the new headers are displayed. but it seems that the store columns have not been updated. the new data is only found in columns that are named the same as the columns defined in the original 'fields' definition.

any ideas? or should I be doing this differently, and instead just destroying and creating a new store upon demand?


I'm using an Ext.data.JsonStore

store.reader.meta.fields = newFields
I'm thinking that the above updates the fields for the reader, but not the fields for the proxy? Or for the store itself?

I've tried removeAll() to clear the dataStore before loading new data, but still no luck.

Now I destroy the store and create a new one every time the user changes the query params. Gets the job done, I guess!