-
5 Oct 2012 12:43 AM #1
Unanswered: store.remove() and store.sync() with localhost proxy what I'm doing wrong?
Unanswered: store.remove() and store.sync() with localhost proxy what I'm doing wrong?
Hi to all,
i have some problems with store.sync() after a store.remove() function
here's my code:
store:
Code:Ext.define('MyApp.store.MyStore', { extend: 'Ext.data.Store', config: { model: 'MyApp.model.MyModel', autoLoad: true, sorters: 'name', proxy: { type: 'localstorage', id: 'mystore' } } });
controllers:
IT WORKS FINE
HERE I GET SOME PROBLEMS:Code:MyADD : function() { //.................. Ext.getStore("MyStore").add(myrecord); Ext.getStore("MyStore").sync(); mystore.load(); //.................. },
The problem is:Code:MyRemove: function() { //.................. Ext.getStore("MyStore").remove(myrecord); Ext.getStore("MyStore").sync(); mystore.load(); //.................. },
if i add some records, reload all the app, and remove the records I have non problems,
if i add a records ad them remove it (without reloading the app) this record seems deleted but reappears after another mystore.load() , the records added BEFORE a reload of the app are succesfully deleted, i have this problemo only with remove() and removeall() , no problems with record adding or modifiyng
I already tried to change autoLoad or autoSync proprieties and load/sync manually without results
what I'm doing wrong?
-
9 Oct 2012 6:45 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 434
- Answers
- 3102
Did you check localstorage if the entry is actually being removed?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
9 Oct 2012 8:03 AM #3
of course i check,
the record get removed from the localstorage (google chrome) ad after a second load() it reappears in the view and in the storage (same id)
I've noticed other unusual behaviors:
* if I "modify" the record with and add() before removing it the cancellation is effective an the record don't reappears
*if i remove ALL records from a store (one by one or removeAll()) and add new records (without reloading the app) I have some visualization problems the localstore contains the right record but in the view I see the previus records (the one originally loaded with the app), if i reload the ap i see all right records.Code:Ext.getStore("MyStore").add(myrecord); Ext.getStore("MyStore").remove(myrecord); Ext.getStore("MyStore").sync(); mystore.load();
If i don't remove all the records everithing works fine. I don't know if this second behavior is related to the first but I'ts causing me much more problems because every removeAll() mess up al the app.
-
15 Oct 2012 11:35 PM #4


Reply With Quote