Cascade Filter Hydrated to Object on Server Side

2 posts, 1 answers
  1. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 12 Jan 2016 Link to this post

    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

    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.



  2. Answer
    Georgi Krustev
    Georgi Krustev avatar
    3724 posts

    Posted 15 Jan 2016 Link to this post

    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:
    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top