I have two grids in a master and detail relation.
When ever the first grids row is clicked the second grid is refreshed with the pertaining child records, for which i use Store.filter(). See Image1.gif
When ever the user clicks on New in the toolbar, a row gets added to the child grid. So far so good. See Image2.gif
But as soon as i navigate to any other record in the parent grid and come back to the original parent record the newly added row is gone.
After much of banging my head, i found that since i am using filter in the second data store, before i insert a row in it i need to clear the filter. Is this a bug or what? and what about performance implications when handling large data.
Code that doesnt work:
function newClicked() {
stateMaster_grid.stopEditing();
// stateMasterStore.clearFilter();
stateMasterStore.insert (0, new Ext.data.Record({
countryCode: selectedCountryCode, //global variable that holds the parent grid clicked country code
recCode: -1,
theName: 'New',
activeFlag: 1
}));
stateMaster_grid.startEditing (0, 0);
// stateMasterGridRefresh(); //function to refresh child grid everytime a row in the master grid is clicked
}
Code that works:
function newClicked() {
stateMaster_grid.stopEditing();
stateMasterStore.clearFilter();
stateMasterStore.insert (0, new Ext.data.Record({
countryCode: selectedCountryCode, //global variable that holds the parent grid clicked country code
recCode: -1,
theName: 'New',
activeFlag: 1
}));
stateMaster_grid.startEditing (0, 0);
stateMasterGridRefresh();
}
stateMasterGridRefresh Function:
function stateMasterGridRefresh () {
stateMasterStore.filter ('countryCode', selectedCountryCode);
};
Any suggestions or am i doing something wrong!!
This has been covered in the past. Try searching for 'snapshot'
Thanks i will
Allergies.. no relief?!?
Religion in the workplace? |