Search code examples
oracle-jet

How to capture "scroll" event for ojlistview


Their documentation (http://www.oracle.com/webfolder/technetwork/jet/jsdocs/oj.ojListView.html) doesn't list any "scroll" event.

How do I capture the "scroll" event, since its not natively supported by Oracle-Jet. Capturing it on the parent "div" is a good idea?


Solution

  • Using jQuery e.g. by

    $("#myList").scroll(function(){console.log("This is scroll");})
    

    with following HTML used (the relevant thing is that the listener should be attached to element identified by id attribute passed in rootAttributes (the ID is not set to the UL as such, but the parent element of UL

    <ul data-id="c-list" data-bind="ojComponent: {component: 'ojListView', 
                                data: dataSource, 
                                selectionMode: 'none', 
                                rootAttributes: {id: 'myList'} }">
    </ul>