Results 1 to 4 of 4

Thread: Modern toolkit Grid with BufferedStore

    You found a bug! We've classified it as EXTJS-19637 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Posts
    23

    Exclamation Modern toolkit Grid with BufferedStore

    Working with Ext 6.2.1.167 Modern Toolkit
    If you try to use Ext.grid.Grid with Ext.data.BufferedStore you get "Cannot read property 'length' of undefined". To fix it I've added this override:
    Code:
    Ext.define('Overrides.dataview.DataView', {    override: 'Ext.dataview.DataView',
        
        onSelectionStoreRemove: function (store, records) {
            var me = this,
                selected = me.selected,
                ln = records? records.length: 0, //Was just ln = records.length
                removed, record, i;
            if (me.getDisableSelection()) {
                return;
            }
            for (i = 0; i < ln; i++) {
                record = records[i];
                if (selected.remove(record)) {
                    if (me.getLastSelected() == record) {
                        me.setLastSelected(null);
                    }
                    if (me.getLastFocused() == record) {
                        me.setLastFocused(null);
                    }
                    removed = removed || [];
                    removed.push(record);
                }
            }
            if (removed) {
                me.fireSelectionChange([
                    removed
                ]);
            }
        }
    });
    Then next error appears: "Cannot read property 'length' of undefined", but in different place, fix it by this override:
    Code:
    Ext.define('Overrides.data.PageMap', {    override: 'Ext.data.PageMap',
        
        hasRange: function(start, end) {
            var me = this,
                pageNumber = me.getPageFromRecordIndex(start),
                endPageNumber = me.getPageFromRecordIndex(end);
            if(!me.hasPage(endPageNumber)) {
                return false;
            }
            for (; pageNumber <= endPageNumber; pageNumber++) {
                if (!me.hasPage(pageNumber)) {
                    return false;
                }
            }
            
            return (endPageNumber - 1) * me._pageSize + me.getPage(endPageNumber).length > end;
        }
    });
    After that it show the grid without errors. BUT number of requests was too big, at the end I found that BufferedStore.viewSize was equal BufferedStore.defaultViewSize (100) so nobody update it according to grid height. As I understand it should do Ext.grid.plugin.BufferedRenderer, as stated at documentation
    but there is no BufferedRenderer in Modern toolkit, so I just can't get is BufferedStore supported in Modern at all?!

    Actually BufferedStore loads some ammount of pages basing on defaultViewSize, and scroll them, until get to the end of loaded records, then leave just blank space, so no new requests for next pages! That also hints that there is nor really communication between grid and BufferedStore like it should be with BufferedRenderer. (In classic everything works ok).

    There is an example of modern Big Data but it doesn't use BufferedStore and example data are returned as one big json, not as really working paging service. Can anyone point to really working modern buffered store example?

    So, please, if it is a bug, fix it ASAP, if I do something wrong, tell me what should I fix?

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Hi--,

    Sorry to hear about your troubles. It would appear buffered stores in the modern grid aren't currently available. There is a documentation bug to get this added (linking to your thread) as well as a feature request in our tracking system (adding below since can only link one).

    EXT-288

    Regards,
    Bryan

  3. #3
    Sencha Premium User
    Join Date
    Nov 2010
    Posts
    23

    Default

    Hi. Thank you for quick response. Can you tell me when approximately will modern grid support buffered store?
    Quote Originally Posted by bjdurham85 View Post
    Hi--,

    Sorry to hear about your troubles. It would appear buffered stores in the modern grid aren't currently available. There is a documentation bug to get this added (linking to your thread) as well as a feature request in our tracking system (adding below since can only link one).

    EXT-288

    Regards,
    Bryan

  4. #4
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Unfortunately I do not have a date in which this would be made available. If you'd like, you can file a Support Ticket with the referenced id's so you can track their current status.

    Best!
    Bryan

Similar Threads

  1. Replies: 1
    Last Post: 13 Dec 2016, 2:21 PM
  2. Replies: 3
    Last Post: 25 Aug 2016, 4:46 AM
  3. Grid in Modern toolkit
    By aruti in forum Ext JS 6.x Q&A
    Replies: 4
    Last Post: 5 Aug 2016, 10:45 AM
  4. grid with CheckboxSelectionModel in modern toolkit
    By raj_plays in forum Ext JS 6.x Q&A
    Replies: 6
    Last Post: 17 Feb 2016, 3:28 AM
  5. [OPEN] Flex on a column in a modern toolkit grid
    By EPV in forum Ext JS 6.x Bugs
    Replies: 5
    Last Post: 21 Sep 2015, 5:07 PM

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
  •