Results 1 to 4 of 4

Thread: working with buffered store

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    249
    Answers
    2
    Vote Rating
    3
      0  

    Default working with buffered store

    I'm working with huge data. So I use buffered store. However almost all functions of store (getById()/find()/filter()/etc.) work with data but not with prefetchData and they don't work. How to solve this issue?

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716
    Vote Rating
    504
      0  

    Default

    Use paging instead of buffered store.

    Scott.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    249
    Answers
    2
    Vote Rating
    3
      0  

    Default

    Quote Originally Posted by scottmartin View Post
    Use paging instead of buffered store.
    I've tried to use Ext.ux.data.PagingMemoryProxy. filter()/sort() work. But
    Quote Originally Posted by http://docs.sencha.com/ext-js/4-1/source/Store.html#Ext-data-Store-method-getById
    Code:
    ...
        getById: function(id) {
             return (this.snapshot || this.data).findBy(function(record) {
                 return record.getId() === id;
             });
         },
    ...
    and
    Quote Originally Posted by http://docs.sencha.com/ext-js/4-1/source/Store.html#Ext-data-Store-method-find
    Code:
    ...
    
        find: function(property, value, start, anyMatch, caseSensitive, exactMatch) {
             var fn = this.createFilterFn(property, value, anyMatch, caseSensitive, exactMatch);
             return fn ? this.data.findIndexBy(fn, null, start) : -1;
         }, ...
    work with only current page. Is there any way to solve this issue?

  4. #4
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Something like this may work instead of store.getById(). Just experimenting but seem working for me.
    getOrderById:function(id){
    var record = this.getById(id);
    if(!record && this.pageMap){ //try buffer
    for (var page in this.pageMap.map) {
    var data = this.pageMap.map[page].value;
    for (var i=0; i<data.length; i++){
    if(data[i].getId() === id)
    return data[i];
    }
    }
    }
    return record;
    }

Posting Permissions

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