Results 1 to 4 of 4

Thread: loadMore shows despite no data when filter is applied to store in ST 2.2

    You found a bug! We've classified it as TOUCH-4465 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    77
    Vote Rating
    2
      0  

    Default loadMore shows despite no data when filter is applied to store in ST 2.2

    I am using a filter on a store to reduce the listings visible. When I do this the emptyText is correctly shown for the list. However, when I do this, the loadMore component still shows even though there is no data. This looks very odd.

    loadmore-no-data-still-shown.png

    Test case

    Code:
    Ext.define('Contact', {
        extend : 'Ext.data.Model',
        config : {
            fields : ['firstName', 'lastName']
        }
    });
    
    var store = Ext.create('Ext.data.Store', {
        model    : 'Contact',
        sorters  : 'lastName',
        autoLoad : true,
        pageSize : 5,
        proxy    : {
            type   : 'ajax',
            url    : 'data/json.json',
            reader : {
                type         : 'json',
                rootProperty : 'data'
            }
        }
    });
    
    Ext.create('Ext.dataview.List', {
        fullscreen : true,
        itemTpl    : '<div class="contact">{firstName} <strong>{lastName}</strong></div>',
        store      : store,
        emptyText  : 'No more records',
        plugins    : [
            {
                type : 'listpaging'
            }
        ],
        items      : [
            {
                xtype  : 'toolbar',
                docked : 'top',
                items  : [
                    {
                        text    : 'add filter',
                        handler : function() {
                            store.filter('firstName', /^x/);
                        }
                    }
                ]
            }
        ]
    });
    Code:
    {
        "total" : 100,
        "data"  : [
            {
                "firstName" : "Tommy",
                "lastName"  : "Maintz"
            },
            {
                "firstName" : "Rob",
                "lastName"  : "Dougan"
            },
            {
                "firstName" : "Ed",
                "lastName"  : "Spencer"
            },
            {
                "firstName" : "Jamie",
                "lastName"  : "Avins"
            },
            {
                "firstName" : "Aaron",
                "lastName"  : "Conran"
            },
            {
                "firstName" : "Dave",
                "lastName"  : "Kaneda"
            },
            {
                "firstName" : "Jacky",
                "lastName"  : "Nguyen"
            },
            {
                "firstName" : "Abraham",
                "lastName"  : "Elias"
            },
            {
                "firstName" : "Jay",
                "lastName"  : "Robinson"
            },
            {
                "firstName" : "Nigel",
                "lastName"  : "White"
            },
            {
                "firstName" : "Don",
                "lastName"  : "Griffin"
            },
            {
                "firstName" : "Nico",
                "lastName"  : "Ferrero"
            },
            {
                "firstName" : "Jason",
                "lastName"  : "Johnston"
            }
        ]
    }

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,415
    Vote Rating
    1269
      0  

    Default

    I'm going to report this as a bug and have provided a test case to reproduce.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Dec 2012
    Posts
    77
    Vote Rating
    2
      0  

    Default

    Thank you mitchell.

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,415
    Vote Rating
    1269
      0  

    Default

    To get around this you can extend the plugin and add a datachanged listener on the store to hide the load more component
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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
  •