Page change,reloads the datasource

Initially the datasource is loaded from database data, based on page size total number of pages are calculated. Then why when we change the page, the datasource gets reloaded again. The data was already in datasource from before itself.It should just immediately load data of that particular page. It is hampering performance of whole application for me.

Please suggest.


3 Replies

AG Ajith Govarthan Syncfusion Team January 5, 2022 05:47 PM UTC

Hi Rachna Bhavsar, 

Thanks for contacting Syncfusion support. 

Based on your query, you are facing dataSource reloading issue in your Grid application. So, before we proceed to your requirement, please share the below details to validate further on your requirement. 

  1. Share the complete Grid code example.

  1. Share the video demonstration of the reported issue.
 
  1. Have you used remote data in your Grid application? If yes, please share the data adaptor used in your Grid application to bind the remote datasource.
 
  1. Share the Syncfusion package version.
 
Regards, 
Ajith G. 




RB Rachna Bhavsar replied to Ajith Govarthan January 6, 2022 12:54 PM UTC

Using URL Adaptor,Page size 20,Syncfusion version 19.2.0.44


<ejs-grid id="ReportedFlatGrid" allowPaging="true" allowTextWrap="true" allowSorting="true" allowMultiSorting="true" height="100%" width="100%">

            <e-data-manager url="/ControllerName/ReportedDatasource" adaptor="UrlAdaptor" />

            <e-grid-pagesettings pageSize="20" />

            <e-grid-columns>

                <e-grid-column ></e-grid-column>

                <e-grid-column disableHtmlEncode="false"></e-grid-column>

            </e-grid-columns>

        </ejs-grid>


public IActionResult ReportedDatasource([FromBody] DataManagerRequest dm)

{}



SK Sujith Kumar Rajkumar Syncfusion Team January 7, 2022 01:02 PM UTC

Hi Rachna, 
 
From the shared details we could see that you are using Url adaptor for binding data to the Grid. This is a remote data adaptor which sends server request for performing each Grid action like, paging, sorting, filtering, CRUD, etc.,. So if you are using this adaptor for binding data, then the code for handling Grid actions needs to be defined in the server side method. So on initial render the Grid will only fetch the current page data from the server and the next set of data will be fetched on performing the paging action. More details on the Url adaptor can be checked in the below documentation link, 
 
 
However if you need the paging action to be performed in the client side itself then we suggest you to use one of the below approaches, 
 
  • Local list binding – Bind the entire local list data directly to the Grid’s dataSource. On using this approach all the Grid actions will be performed in client-side. More details on this can be checked in the below documentation link,
 
 
  • Remote save adaptor – This is a remote data adaptor but it will bind the entire list data to the Grid’s dataSource. On using this approach all the Grid actions except CRUD operations will be performed in client-side. The CRUD operations need to be handled in the server side. More details on this can be checked in the below documentation link,
 
 
  • Offline mode – This mode can be enabled when binding remote data to the Grid. Enabling this will allow the grid to load all data on initialization and make the actions process in client-side. More details on this can be checked in the below documentation link,
 
 
So we suggest you to use the required approach which best suits your requirement. 
 
Let us know if you have any concerns. 
 
Regards, 
Sujith R 


Loader.
Up arrow icon