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

Cascade Filter Hydrated to Object on Server Side

1 Answer 132 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 13 Jan 2016, 03:26 AM

In the Cascading ComboBoxes docs, it shows the parameters of the request will be:

filter[logic]: and
filter[filters][0][field]: parentID
filter[filters][0][operator]: eq
filter[filters][0][value]:

But nowhere does it say what the data structure on the server side should be. I've got MVC Complete (MVC 4, VS2010, Kendo v2015.3.1111) and tried the DataSource object (with attribute), but no luck.  Any suggestions?

I even went to far as to replicate what I think would be the data structure on the server, but that didn't work either. This is what I tried:

public class DropDownListFilterItem
{
    public string Field { get; set; }
    public string Operator { get; set; }
    public string Value { get; set; }
}
public class DropDownListFilter
{
    public string Logic { get; set; }
    public List<DropDownListFilterItem> Filters { get; set; }
}

and the single argument to the Controller Action was of type DropDownListFilter.

Thanks,

--Ed

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 15 Jan 2016, 08:19 AM
Hello Ed,

Generally speaking, the DropDownList widget uses the DataSource component to perform all CRUD operations. That being said, the datasource will send the filter expressions to the server in the described format (basically stringified JSON). If you would like to parse those expressions on the server, then you can either format the expressions on the client using parameterMap: or use for instance Dynamic Linq to parse the expressions on the server: The last demo uses Kendo DynamicLinq helpers:
If you are using UI for ASP.NET MVC, then you can even use Custom DataSource and hence benefit from the DataSourceRequest model:
Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
DropDownList
Asked by
Ed
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or