This is a migrated thread and some comments may be shown as answers.

Support for grid data operations in Custom data-binding directive

4 Answers 205 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chau
Top achievements
Rank 1
Chau asked on 09 Mar 2018, 05:30 AM

I am following the sample instructions from the link: https://www.telerik.com/kendo-angular-ui/components/grid/data-operations/data-binding/automatic-operations/#toc-custom-directives

In the ProductsBindingDirective, the rebind method calls the service passing the state of the grid.

In the ProductsService which extends NorthwindService (extending BehaviorSubject), the fetch method sends a request to the Base_URL with the grid state info passed as query string parameters, e.g. https://odatasampleservices.azurewebsites.net/V4/Northwind/Northwind.svc/Products?$orderby=UnitPrice&$count=true&$skip=0

Question: Does the Northwind.svc execute a SQL query for every fetch method request, and rebuild a new result set based on the query string parameters? Or does it execute the SQL query once, and applies the query string parameters criteria (skip, orderby, pagesize, etc)  on the same result set initially retrieved?

In my case, I have a query returning tens of thousands of records, so I want to confirm which component is processing the grid state information. Should the ProductsService (being a BehaviorSubject) keep the initial big result set as its own property and apply the grid state criteria, or does it just pass the grid state to the server and expect to receive the correct data?

Thanks!

 

4 Answers, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 12 Mar 2018, 11:27 AM
Hi Chau,

The service just sends a request with the current grid state to the server. Then the server performs the search logic and returns the filtered data to the service which in turns passes the data to the grid.

I hope this helps. Please let me know in case you need further assistance for this case.

Regards,
Svetlin
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Chau
Top achievements
Rank 1
answered on 12 Mar 2018, 04:46 PM

Hi Svetlin,

Do you have a code snippet for applying the grid filter criteria on the server-side, i.e. the code logic used in Northwind.svc?

Thanks!

0
Svet
Telerik team
answered on 14 Mar 2018, 12:40 PM
Hi Chau,

In general, the server side filtering could be implemented using any server-side technology following common practices.

For the specific case, we are just using the odata service as is and cannot provide its source code as it is not developed by us.

export abstract class NorthwindService extends BehaviorSubject<GridDataResult> {

For more details on how to implement filtering using an odata service please check the following article:

http://www.odata.org/getting-started/basic-tutorial/#filter

Regards,
Svetlin
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Chau
Top achievements
Rank 1
answered on 16 Mar 2018, 05:29 PM
Thanks Svetlin!
Tags
General Discussions
Asked by
Chau
Top achievements
Rank 1
Answers by
Svet
Telerik team
Chau
Top achievements
Rank 1
Share this question
or