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

ServerSorting and ServerFiltering on child attributes or custom properties

1 Answer 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 04 Aug 2014, 11:05 AM
I have a blocking issue on my serverside filtering and sorting of data.
My Kendo Grid sends requests to my C# backend.
This is what happens:

I fetch all Employee objects (I use Data Access)
An employee has a Person object, which contains person info like FirstName, LastName etc.
And it also has a GroupName
So my scheme is:

schema: {
    model: {
        id: "ID",
        fields: {
            FirstName: { type: "string", from: "Person.FirstName" },
            LastName: { type: "string", from: "Person.LastName" },
            GroupName: { type: "string" },
        }
    }
},

When I use a filter or sorting on the firstname or lastname, it wil try to filter the employee on attribute "Person.FirstName".
But the person is an addition to my DataAccess object, so it is not in the database.

When I use a filter or sorting on GroupName, it will also try to just filter on the groupname. But the groupname is filled in the backend and comes from EmployeeGroup.Name

So I am not able to filter serverside on any of these rows.
I would really love to know if there is any possibility to filter on custom attributes or childattributes.

Thanks in advance!

- Jason

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 06 Aug 2014, 07:57 AM
Hello Jason,

DataSource uses the fields defined in the model to build descriptors for filter/sort/group etc. In the context of MVC wrappers default implementation (i.e ToDataSourceResult ) will process the data on server using above descriptors. It will apply the required data transformation depending on the descriptors/context send from client.

The only way to control what and how to be processed is to implement Custom Binding. This way the developer have full control over the data transformation pipeline.

Regards,
Nikolay Rusev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or