Results 1 to 10 of 18

Thread: Ext: 4.2.0 Beta: Object [object Object] has no method 'filterBy'

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Join Date
    Mar 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default 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?

  2. #2
    Sencha User dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,742
    Vote Rating
    258
      1  

    Default

    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

    "Use the source, Luke!"

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,862
    Vote Rating
    85
      0  

    Default

    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.
    Longtime Sencha engineer. Now surplus to requirements apparently...

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    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()?

  5. #5
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Vote Rating
    392
      0  

    Default

    Quote Originally Posted by Mayor_McCheese View Post
    Is there a better (recommended) way to remove the red triangle than commitChanges()?
    http://docs.sencha.com/ext-js/4-1/#!...-cfg-markDirty

  6. #6
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,184
    Vote Rating
    42
      0  

    Default

    Code:
    findBy is not supported. It's meaningless in a sparse store.
    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.

    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.

  7. #7
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    765
    Vote Rating
    76
      0  

    Default

    This does not work for me in 4.2.0 with:
    PHP Code:
    config.viewConfig = {
        
    markDirty false,
        
    emptyText 'strNoItems' 
    }; 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •