Results 1 to 10 of 17

Thread: Buffered store.findExact() throw Object [object Object] has no method 'findIndexBy'

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Nov 2010
    Location
    Ukraine
    Posts
    15
    Vote Rating
    0
      0  

    Default Buffered store.findExact() throw Object [object Object] has no method 'findIndexBy'

    Hi again!
    I found that method store.findExact() call store.data.findIndexBy();
    For most stores store.data property is Ext.util.MixedCollection which has findIndexBy() method.
    But if store.buffered data property is PageMap (extend: 'Ext.util.LruCache', 'Ext.util.HashMap'). All this classes has no findIndexBy method =(

    Code:
           if (me.buffered) {
                me.data = new me.PageMap({
                    store: me,
                    pageSize: me.pageSize,
                    maxSize: me.purgePageCount,
                    listeners: {
                        // Whenever PageMap gets cleared, it means we re no longer interested in 
                        // any outstanding page prefetches, so cancel tham all
                        clear: me.onPageMapClear,
                        scope: me
                    }
                });
                me.pageRequests = {};
    
                me.sortOnLoad = false;
                me.filterOnLoad = false;
            } else {
        
                me.data = new Ext.util.MixedCollection(false, Ext.data.Store.recordIdFn);
                me.data.pageSize = me.pageSize;
            }

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

    Default

    How do you initiate this search? Since a buffered store is designed to be a partial view of the remote data, at best, only some records will be local and hence findable.

    I recall that we did merge a fix (it may be new to 4.2.0 beta 2 - http://www.sencha.com/forum/showthre...-Now-Available) that should allow you to find records that are "in view" under the assumption that this is often initiated by a row action or similar and the record is certain to be local.

    Beyond that special case, all other operations that would require complete knowledge will probably fail in this way as there is no point in implementing methods that cannot possibly work with partial data.
    Don Griffin

    "Use the source, Luke!"

  3. #3
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    89
    Vote Rating
    2
      0  

    Default

    This is not fixed in the 4.2.0 release. As long as store is buffered, both find and query fail.

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

    Default

    We have a "fix" for this ready to go.

    But you do understand the limitation don't you?

    You will only get to search the few patches of the dataset that you have visited.
    Longtime Sencha engineer. Now surplus to requirements apparently...

  5. #5
    Ext JS Premium Member
    Join Date
    Oct 2007
    Posts
    89
    Vote Rating
    2
      0  

    Default

    Thanks for the reply. Yes I do understand the limitation. In our app, we make sure the record we want find is fetched from the server side in a buffered store. So what is the fix? or when it will be available?

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

    Default

    If that is the case, why is the store buffered then? Just want to understand the use case here
    Don Griffin

    "Use the source, Luke!"

Tags for this Thread

Posting Permissions

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