Infinite scrolling with pagination in Data Grid

0
Hello All, How to enable infinite scrolling in data grid to load more data from API?. I have a data grid in which i need to fill  data from API using POST request, where as API supports paging via offset and limit when user reaches end of data grid i need to make subsequent API call's by changing offset and limit and append the new response set into data grid. Please help .
asked
3 answers
0

Yeah, that is not how a regular datagrid works. You could try mimicking a datagrid in a list view which has widgets to support infinite scroll in the AppStore. But that infinite scroll widget for as far as I know does not call an MF to get the next set of results. So you might need to adjust it yourself.

 

I would lose the datagrid approach though as that widget is too rigid in my opinion to achieve your goal.

Feel free to reach out to me in the Mx community Slack to brainstorm some more about it.

answered
0

I think you would have to build your own widget for this….

answered
0

The quickest way I can think of is to add a “load more” button that will pull the next set of data, then refresh your data grid.  Then set your data grid to have a large page size (larger than your expected full data set) which you put into a scrollable div container.  You would likely lose your place on where you scrolled to, but might be able to achieve that with some javascript.

If you are comfortable with CSS, a list view would look better, but as Mitchel said, does not natively support calling a MF on “load more” so you would still have to use a separate button.

The best solution would probably be a custom plugable widget with repeating containment introduced in 8.7, but this will require you know React.

answered