-
10 Aug 2010 12:59 PM #1
[FIXED-213] List not refreshing snapshot when calling loadRecords
[FIXED-213] List not refreshing snapshot when calling loadRecords
As can be seen below, after modifying the store by calling loadData, the snapshot is not updated to reflect the latest clean data source, but instead represents the first loaded data source. I'm doing advanced filtering in my application (because NestedList is not yet inheriting from list, so I'm basically coding NestedList with filters). To workaround for now I am calling "delete store.snapshot;" before "store.loadData(..."
Code:Ext.setup({ onReady: function () { var data = []; for (var x = 0; x < 100; x++) data[data.length] = { html: x }; new Ext.List({ fullscreen: true, store: new Ext.data.Store({ fields: ['html'] }), tpl: new Ext.XTemplate('<tpl for="."><div class="list-item">{html}</div></tpl>'), itemSelector: '.list-item', dockedItems: [{ dock: 'top', xtype: 'button', text: 'shorten list', handler: function () { var store = this.ownerCt.getStore(); store.loadData([{ html: 'invisible'}]); alert(store.snapshot.getCount()); } }] }).getStore().loadData(data); }});
-
11 Aug 2010 9:41 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
Nice, two bugs with the same example.
-
11 Aug 2010 9:45 AM #3
Just out of curiosity... what's the second bug? I'm assuming the first one is that snapshot is not maintained correctly in loadRecords
-
11 Aug 2010 9:54 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
http://www.sencha.com/forum/showthre...n-after-reload
You changed the handler, but the sample is the same.
-
25 Aug 2010 9:45 PM #5
I didnt really understand this issue. Im have problem to get the store sorted after I add new records.
-
3 Sep 2010 7:38 PM #6Sencha - Community Support Team
- Join Date
- Jan 2009
- Location
- Palo Alto, California
- Posts
- 1,941
- Vote Rating
- 6
I've refactored this to add records via store.add instead of the custom adding logic that used to exist inside loadData. This alleviates the snapshot issue and should standardize the loading process further.
Ext JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer
-
28 Mar 2012 12:19 AM #7
how to fix it?
how to fix it?
I got this issue in my app (ST 1.1)
how to fix it?
thanks!
-
28 Mar 2012 12:29 AM #8
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
Snapshot in Store
By harsha_velicheti in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 6 Feb 2012, 8:32 AM -
Refreshing a list's view
By danvega in forum Sencha Touch 1.x: DiscussionReplies: 2Last Post: 22 Jul 2010, 4:55 AM -
[OPEN] [FIXED] A ComboBox's empty text is not shown when calling clearInvalid
By Jose Jeria in forum Ext GWT: Bugs (2.x)Replies: 2Last Post: 8 Sep 2009, 10:46 AM -
[FIXED] List.add(List) in BeanModelReader
By sdc in forum Ext GWT: Bugs (1.x)Replies: 3Last Post: 16 Jul 2008, 11:50 PM


Reply With Quote