c# - Prevent Kendo Grid from running two queries -
Currently, when I attach a datasource to a condo grid, it two Runs. First of all: A Second: One <<> My problem is that even with Enabled (false). Information (false)) This is still running the query (*) query. The query I'm running is very expensive and I would like to finish running the first query (*) query If you want to separate the data into pages, then you have to find a way to count the server The way you can not get around it As CodingWithSpeak said, it may take longer to show all the rows in the same page that you have to get this count (*) so that you have some solutions at this point. A) You set maximum rows to fetch in the same page. Just make sure the user knows about this limit. B) If the number of records in your table is constant, you can cache the count on the server. C) You can also cache the table data on the server side, it will speed up the counting and receiving data. However, you should understand the load on the server's memory and the fact is that the data taken from the cache is not up to date (you can consider every x-minute refreshing data). If you want to go with option B or C, you probably have to implement your own read logic (Data Source.portfolio object) to get data cached on the server. EDIT It is known that you will never get more than 100 rows, I have come up with just one hybrid solution. Except the counting), which will be calculated on the client side: D) To get only the top 100 rows from the server, data source: Override the read log logic of the transport. In the read function, there is an option parameter object that can be used to return data in a format that will be handled by the grid (example: odata object). Usually, the count received by the OData object is calculated on an inline calculation server so you can see how many records match your filter. In your case, this will always be the number of rows returning to your Odata object so that you can successfully set it on the client side without any calls before calling it. View the read as read section here (see calculation (*) to create the correct number of pages and tells the user how many records are present.
. Pageable (p = & gt; p).
Comments
Post a Comment