Hi, I wanted to use `SF Grid` for one of our requirement for my client (he is ready to purchase SF license if this fulfills), but wanted to check the feasibility for the same.
Requirement : Display a grid in angular application with infinity scrolling, data will be send by API in below format :
{
"next": "ab354cde", // call api with this Id to fetch next result set
"previous": "efd657rtf12",
// call api with this Id to fetch pre result set
"size": 103, // can vary for each call to server
"rows" : [] // actual data
}
Explanation :
Our API service for search sends the dynamic result set what i mean by that is whenever i call the backend API it will send me the data in below format :
{
"next": "ab354cde",
"previous": "efd657rtf12",
"size": 103,
"rows" : []
// actual data
}
where `next` and `
previous` will be the identifier to fetch the next/previous result set from the server, size will send the size of current data set and the rows will contain actual data. The catch is because the API is designed on a large data set it it doesn't guaranty the fixed result `size`. Which means on API call 1 I might receive 130 records and on second call with next value I might receive 120 records and so.
Will this kind of requirements is achievable in SF grid.
HI Rajapandi Ravi,
Thanks for the detailed response, our use case is little different so wanted to check feasibility first, I will try my best to explain this.
Here is our api details along with request and response:
Our API endpoint always consist the queryId
http://localhost:4200/api/query/{queryId}
example :
http://localhost:4200/api/query/343967d18997be586df693fd0bdd962
so whenever we landed on the grid page for the first time we already have a query id to fetch the data.
once that call is made to the server, it returns the data in below format.
{
"next": "ab354cde", // call api with this Id to fetch next result set
"previous": "efd657rtf12", // call api with this Id to fetch pre result set
"size": 103, // can vary for each call to server
"rows" : [] // actual data
}
Where next/previous
are the queryId's to fetch next or previous (scroll up / scroll down) data. size defines the size of current result set and can vary for each call to the server,
for example if first call made to to server with queryID : 'abcd1234' server can return below data
{
"next": "ab354cde",
"previous": "efd657rtf12",
"size": 103,
"rows" : [] // actual data
}
now if user scrolled down and a new call triggered with queryId : `
ab354cde`
once reached to the bottom we can receive data as follows :
{
"next": "wervsdf23",
"previous": "cvsadwe123",
"size": 130,
"rows" : [] // actual data
}
look here the size got changed and now we have received 130 records, and user further scroll down the
size
value can vary.
So our question is how can we utilize SF grid with infinity scroll along with caching for such API behavior.