PDA

View Full Version : Problem with store when using the groupingsummary feature.



KostasP
30 Jul 2012, 11:20 AM
I have a grid that uses grouping summary and a remote proxy. On double clicking any row a form pops up to edit the values of this row and then syncs the store with the DB. All goes well if I don't change the value of the field that is the groupField. If I change the value of that field while the right values are stored in the DB and the grid displays the right data when I double-click a row the form doesn't load that row's record but another one, usually the one right below that one. And that doesn't happen only for the changed row but for others too. It's as if the index is messed up from the new place that this record goes and below, like shifted down one. If i refresh the page everything is back to normal and the changes are done correctly.

Any idea why is this happening? Do i need to do something after syncing the store with the DB?

KostasP
30 Jul 2012, 11:25 AM
the only way i found to workaround this problem is to load the store again. But i think that's not normal cause if there is a lot of data doing that for every change would be time-consuming and causing delays....

bclinton
30 Jul 2012, 3:08 PM
Any idea why is this happening? Do i need to do something after syncing the store with the DB?

You didn't post any code which makes it kind of difficult to guess at what the problem could be, but is it possible you just need to do a grid.getView().refresh(); ?

KostasP
31 Jul 2012, 7:27 AM
edtSth:function(button) { var win = button.up('window'),
form = win.down('form'),
record = form.getRecord();
values = form.getValues();
if (!values.SthItem || values.SthItem=="" || !values.SthStgID || values.SthStgID==0){
Ext.Msg.alert('Σφάλμα!', 'Πρέπει να συμπληρώσετε Είδος και Κατηγορία για να καταχωρίσετε το αντικείμενο!');
return;
}
record.set({
SthStgID: values.SthStgID,
SthItem: values.SthItem,
SthCategory: values.SthCategory,
SthUnit: values.SthUnit,
SthUnitPrice: values.SthUnitPrice,
SthApprovedLevel: values.SthApprovedLevel,
SthReorderLevel: values.SthReorderLevel,
SthReorderQuantity: values.SthReorderQuantity
});
//console.log(record);
var store = this.getStItemsStore();
store.sync();
//Ext.ComponentManager.get('sthlist').getView().refresh();
store.load();
win.close();
}

That's the funtion handling the "save" button of the popup form. I tried getView.refresh() with no result....

bclinton
31 Jul 2012, 1:52 PM
Try a store.sort() instead of the store.load() and see if that does the trick. (though if it's a remotely sorted store I guess this really won't be an improvement)

KostasP
31 Jul 2012, 2:33 PM
done, no change, same problem.

KostasP
6 Aug 2012, 2:53 PM
Anyone else? any ideas on the matter?

KostasP
21 Sep 2012, 12:46 AM
I believe that this is a major issue and either i'm doing something wrong or it's a bug.