Author Topic: Handle onScrollBottom event?  (Read 3619 times)

motoguru

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 35
    • View Profile
Handle onScrollBottom event?
« on: February 25, 2014, 02:28:55 am »
Hello again :)

Bored of my questions yet? :)

Is there any method of handling event when user scrolled to the bottom of grid? I want to add some remote data to local data then. (flexheight: false, pagination: disabled, all rows on page, like infinite scroll on free version Demo)

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Handle onScrollBottom event?
« Reply #1 on: February 25, 2014, 04:03:27 pm »
First you need to get reference to vertical scroll bar.

Then listen to scroll event

http://paramquery.com/pro/api/scrollbar#event-scroll

cur_pos and num_eles would indicate the current position of scrollbar. When cur_pos is nearing num_eles, it indicates that it's near the bottom and you can add chunks of rows to dataModel.data at that moment and refreshView.
« Last Edit: February 25, 2014, 04:05:56 pm by paramquery »

motoguru

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: Handle onScrollBottom event?
« Reply #2 on: February 25, 2014, 05:51:49 pm »
Great stuff. Thanks