Hybrid View
-
14 Dec 2012 7:41 AM #1
Ext: 4.2.0 Beta: Object [object Object] has no method 'filterBy'
Ext: 4.2.0 Beta: Object [object Object] has no method 'filterBy'
I'm getting the following error while calling sync() on a buffered store:
....
Uncaught TypeError: Object [object Object] has no method 'filterBy' ext-all-debug.js:65308
Ext.define.getNewRecords ext-all-debug.js:65308
Ext.define.sync ext-all-debug.js:61855
buffer-grid.js:124
Ext.define.fireHandler ext-all-debug.js:43790
Ext.define.onClick ext-all-debug.js:43780
Ext.apply.createListenerWrap.wrap ext-all-debug.js:10303
...
code:
var store = Ext.create('Ext.data.Store', {
id: 'store',
buffered: true,
pageSize: 5000,
model: 'Employee',
proxy: {
type: 'ajax',
method : 'GET',
api: {
read: 'getEmployees.xml',
update: 'setEmployees.html'
},
reader: {
root: 'employees',
record: 'employee',
type: 'xml'
},
writer: {
documentRoot: 'employees',
record: 'employee',
type: 'xml',
writeAllFields: false
}
}
});
After some investigation on my own I noticed that a buffered store uses Ext.util.LruCache which lacks the method filterBy that Ext.util.AbstractMixedCollection has, which seems to be used on a non-buffered store.
Can someone confirm if this is a bug or if I'm doing this the wrong way?
-
14 Dec 2012 1:29 PM #2
The results of editing a buffered store (the prerequisite to calling sync) are not likely to be desirable. The concept of a buffered store is a large, partially available, result set. Since the entire data set is never available to the client, edits cannot be properly handled. For example, sorting and filtering cannot be updated properly because these must be handled by the server. Also, the page cache has not provision for adding or removing records.
If you turn off the buffered config on the store, what you are doing should work fine.Don Griffin
Ext JS Development Team Lead
Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue
"Use the source, Luke!"
-
16 Dec 2012 4:57 AM #3
Actually, I can see why filterBy might be wanted on a sparse store. You still might want to filter what you can see.
filterBy is implemented in another ticket - the one about findBy.
findBy is not supported. It's meaningless in a sparse store.Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
19 Dec 2012 4:36 AM #4
We are getting the same error when using store.commitchanges() on a buffered store. The only reason though is to get rid of the "dirty" red triangle on the edited cell - the actual data manipulation is handled spearately.
Is there a better (recommended) way to remove the red triangle than commitChanges()?
-
19 Dec 2012 4:55 AM #5
-
19 Dec 2012 7:05 AM #6Ext JS Premium Member
- Join Date
- Apr 2008
- Location
- Groningen - Netherlands
- Posts
- 1,022
- Vote Rating
- 23
I disagree with that. Even on a sparse stores there should be some functions to search records in the store or in its page maps. Besides a local filter is common on retrieved records. I have that functionality to narrow down the search on retrieved records.Code:findBy is not supported. It's meaningless in a sparse store.
I also see that the Ext.util.LruChache isn't documented yet, but in that class should be some search functionality.
I think backwardscompatibility is lost now by introducing this new 'buffered' in version 4.2. But hopefully with that bufferedgrid plugin I don't need it anymore.
-
4 Jan 2013 3:53 PM #7
This does not work for me in 4.2.0 with:
PHP Code:config.viewConfig = {
markDirty : false,
emptyText : 'strNoItems'
};


Reply With Quote
