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
    azamatoak is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,074
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    I'm going to report this as a bug and have provided a test case to reproduce.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    azamatoak is on a distinguished road

      0  

    Default


    Thank you mitchell.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,074
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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.