PDA

View Full Version : Refresh of page shows changes but not in m GridPanel



matn1
23 Oct 2012, 6:58 AM
Hello:

EXT JS 3.4 I was wondering why I get no errors in both FireFox and Chrome when the database reflects the correct values on refresh of page but the datagrid still has old values until I do a page refresh?

Any help would be appreciated.

I have a datagrid with2 combo boxes that I update values in the back-end. My data store
captures when I select and change a value in my combo Box
At the end of my comboBox select handler I do the following and Updated gets displayed so I know it gets updated in the database. I then try to refresh the view but sometimes I need to reload the entire page to see my changes.

Any ideas?

success:function(r) { json = Ext.util.JSON.decode(r.responseText);
if (json.message == 'OK') {
Ext.MessageBox.alert('Information', 'Updated');
} else {
Ext.MessageBox.alert('Error Message', json.message);
}
},
failure: function(r){
Ext.MessageBox.alert('Error Message', r.responseText); }
});
// Reload and Reset the Data
mstore.load();

mstore.on('load', function() { cmbUS.setValue(mstore.data.om_personcode_us);
cmbCH.setValue(mstore.data.om_personcode_ch);
// Thought this would do the trick - but I have to refresh the page through the browser
Ext.getCmp('mgridPanel').getView().refresh();
});

willigogs
24 Oct 2012, 1:12 AM
Would you be able to provide a bit more code, or possibly a working example of this - since anytime a store is successfully updated with new/updated records, the grid/component using the store should automatically reflect this change.

The fact that your grid isn't being refreshed would more likely point to the store not actually being updated with new data.

scottmartin
24 Oct 2012, 4:49 AM
What does your response JSON look like? You grid should display the updated data the same as if you loaded the data for the first time.

Just a sample of your response, and not all records will be fine.

Scott.

matn1
24 Oct 2012, 2:19 PM
hey guys thanks for responding back.

I believe it was the fact as willigogs mentioned my data wasn't being reloaded, as soon as I moved
the mstore.load() in the success block it's been working a lot better