Add headers through ej.DataManager or some other way AND Pagination

Hi,

We're using on our projectan API RESTfull that allow us to return a requisition through HTTP Headers.

So, we would like to know if it's possible to perform requisitions with headers additions using ej.DataManager or if we should use any other way like JQuery to obtain data.
And, the second doubt is about pagination.

Our goal at the beginning is to avoid bringing all records in one go, just get few records on the first page and when we call the next page (next or previous), we ask for a corresponding new range for the page.

For example: On page 1, Return: 1-10 records | On page 2, Return: 11-20 records | ... On page X, Return: X-X+10 records

Which is the better way to implement this situation?

NOTE: We're using PostgREST.

Thank you.

3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team October 25, 2017 01:38 PM UTC

Hi Rodrigo, 

Thanks for contacting Syncfusion support. 

Query : “We would like to know if it's possible to perform requisitions with headers additions using ej.DataManager” 

Yes it is possible add custom headers in ej.DataManager using headers property. For more information, refer the below help document.  


Query : “Our goal at the beginning is to avoid bringing all records in one go, just get few records on the first page and when we call the next page (next or previous), we ask for a corresponding new range for the page” 

According to your query we suspect that you are expecting loadOnDemand concept in Grid. This concept can be achieved using the adaptors of the DataManager. Using the URLAdaptor, Grid collects the data (need for current page) from the server and updated in Grid. So, only the current page of cells will be rendered in DOM Elements.  
 
Refer to the Help document for the Url Adaptor.  
 

Regards, 
Prasanna Kumar N.S.V


RC Rodrigo Carrapeta October 27, 2017 08:48 PM UTC

Thank you for the answer.



TS Thavasianand Sankaranarayanan Syncfusion Team October 30, 2017 05:35 AM UTC

Hi Rodrigo, 
 
We are happy that the problem has been solved at your end. 
 
Please get back to us if you need any further assistance.  
 
Regards, 
Thavasianand S. 
 


Loader.
Up arrow icon