3

I configured scroll events in a dataview but they don't fire. The rest of scrollable configuration is OK, just the listeners conf doesn't seem to be considered. Any clue ?

{   itemId:'names',
    xtype:'dataview',
    disableSelection:true,
    scrollable:{
        direction:'vertical',
        listeners:{
            scroll:function(){
                console.log('[scrollable][on scroll]');
            },
            scrollend:function( scroller, x, y, eOpts ){
                console.log('[scrollable][on scrollend]x='+x+', y='+y);
            }
        }
    },
    store:{
            fields:['name'],
            data:[{name:'Cherif'}]
    },

    itemTpl:'{name}'
}

1 Answer 1

5

Edit: Actually tried suggested fix out this time

You need to put the listeners config inside a scroller as demonstrated in this jsFiddle:

{
    xtype:'dataview',
    fullscreen: true,
    scrollable: {
        direction:'vertical',
        scroller: {
            listeners:{
                scroll:function(){
                    console.log('[scrollable][on scroll]');
                },
                scrollend:function( scroller, x, y, eOpts ){
                    console.log('[scrollable][on scrollend]x='+x+', y='+y);
                }
            }
        }
    },
    store: {
        fields: ['name', 'age'],
        data: [
            {name: 'Jamie',  age: 100},
            {name: 'Rob',   age: 21},
            {name: 'Tommy', age: 24},
            {name: 'Jacky', age: 24},
            {name: 'Ed',   age: 26}
        ]
    },

    itemTpl: '<div>{name} is {age} years old</div>'
}
1
  • @Cherif trying to set listeners for scroller not for dataview. Also there is no scroll or scrollend event for dataview.. did you noted that ?
    – Viswa
    Sep 18, 2013 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.