-1

I try getting scroll position, for infinity scroll (top)

<RadListView row="1" 
  [items]="_dataItems" 
  (scrolled)="onScrolled">

  onScrolled(scrollOffset) {
    this.scrollOffset = scrollOffset;
    console.log(this.scrollOffset); // undefined
  }

1 Answers1

0

Refer the Documentation / TypeScript declarations carefully.

With Angular you event binding should call the function with the $event object to get access to event arguments

<RadListView row="1" 
  [items]="_dataItems" 
  (scrolled)="onScrolled($event)">

Without above fix you event callback will never be called.

Secondly, what you receive in the event is type of ListViewScrollEventData.

onScrolled(event) {
   this.scrollOffset = event.scrollOffset;
   console.log(this.scrollOffset); // undefined
}
Manoj
  • 21,753
  • 3
  • 20
  • 41