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

Custom POST method on filtration and paging in Kendo Grid

2 Answers 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
P r e m k u m a r
Top achievements
Rank 1
P r e m k u m a r asked on 21 Apr 2015, 03:58 AM
Hi Team,

Greetings to you!

I'm new to Kendo UI. I just seen the demos. It's having very cool in-build features.

I'm implementing the Kendo Grid to my existing angular application. It is working fine. But facing some challenges in filtration, paging and sorting.

In my existing application, all the filters. paging and sorting were implemented as POST service. 

 E.g.:

Request URL: http://localhost:8085/companies/filter

Request Method: POST

Request Payload:

{
    "filterProperties": [{
        "propertyName": "CompanyName",
        "value1": "false",
        "operator": "Google"
    }],
    "sortingProperty": [{
        "field": "id",
        "sortingOperator": "ASC"
    }],
    "pageProperties": {
        "pageNumber": 1,
        "pageSize": 5
    }
}

I'm dealing with lakhs of data and can't have everything in front-end. So, I've went for server call for every action. By default, I'll load only 5 or 10 item in the grid.

I've checked the remote data binding demo (http://demos.telerik.com/kendo-ui/grid/remote-data-binding). It is implemented using query string in request header. 

Can I get some example on custom server data binding in POST method?

Appreciate your support on this.

 

Thank you,

Premkumar

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 23 Apr 2015, 06:33 AM
Hi Premkumar,

By POST service do you mean a AngularJS service or a server-side endpoint? In the first case you will need to implement custom transport read function which to call the AngularJS service passing the required information similar to the way shown in this blog post. The current filtering, sorting, paging, grouping descriptors will be passed into the read function as the data field of the first function argument.

For the second scenario you should configure the read options as appropriate. The default remote transport implementation uses jQuery ajax behind the scene, thus you should use similar setting as when using the $.ajax. Note that in order to change the default shape of the data send to the server - for example mapping the descriptors into a different parameters, you will need to use the parameterMap function.

Please be aware that in order DataSource to pass the filtering, sorting, paging etc. descriptors you should enable the appropriate server operation.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
P r e m k u m a r
Top achievements
Rank 1
answered on 05 May 2015, 05:22 AM

Hi Rosen,

Thank you so much!

I got a better understanding on the custom transport. I missed that part in my code.

Thank you again!

Tags
Grid
Asked by
P r e m k u m a r
Top achievements
Rank 1
Answers by
Rosen
Telerik team
P r e m k u m a r
Top achievements
Rank 1
Share this question
or