when i scroll , i need to add lazy loading to call backend and get data

Answered
sabby asked on September 8, 2017

I am adding lazy loading so all data should not come up at once to pivot. say 1000 records and when user starts scrolling and had scrolled 500 records, backnd api call will be made to get next 1000 records and so on.  So do we have any scroll event so i can make backend call?
in order to do that (as i have million for records in pivot) i need some client side changes too.
 
like for filter ,since  i will have only 1000 records i have to customize filter option so type ahead in search box should search  in bigger set of data not whats present in pivot at that moment of time. 
 
 

5 answers

Public
sabby September 8, 2017

something like : 
componentDidMount() {
this.lazyLoadItems();
window.addEventListener('scroll',this.lazyLoadItems,false);
}

Public
sabby September 8, 2017

document.body.addEventListener('contextmenu', onRightClick);    something like this but ON flexmonster table (whole table scroll) 
and eevent as onscroll down.
can you assist?

Public
Dmytro Zvazhii Dmytro Zvazhii Flexmonster September 11, 2017

Hello Sabby,
Thank you for the detailed explanation. For now, we do not have such sort of events available. If you need to rich a better performance please read our blogpost - https://www.flexmonster.com/blog/blog-perform-faster/
Regards,
Dmytro.

Public
sabby September 11, 2017

 i have already optimzed query and used compression. 
 
we need something on client side and onScroll event we need to populate more data in pivot rather then loading all. 
specially in flat view. Any suggestion? would you be able to add ONscroll of data in table event in next couple of months by any chance?

Public
Tanya Gryshko Tanya Gryshko Flexmonster September 15, 2017

Hello Sabby,
Currently, we are not able to come up with any other suggestions. Please find the answer about onscroll in another thread.
Regards,
Tanya

Please login or Register to Submit Answer