MVC Model Binding with Filters

2 posts, 0 answers
  1. Evan
    Evan avatar
    14 posts
    Member since:
    Oct 2012

    Posted 28 Jan 2013 Link to this post

    I have some comboboxes that cascade from one to the other.  I would also like to be able to filter based on partial text entered into the combobox.  This isn't working out of the box, so I'm working on coding it server-side.  It appears that the text is being posted to the servers, but I can't find a server-side object to bind to the post.  Here's what's being posted.  In my case "Value" is the value of the parent combobox this combobox is cascading from.

    1. filter[logic]:
    2. filter[filters][0][field]:
    3. filter[filters][0][operator]:
    4. filter[filters][0][value]:
    5. filter[filters][1][value]:
    6. filter[filters][1][field]:
    7. filter[filters][1][operator]:
    8. filter[filters][1][ignoreCase]:

    I took a look at IFilterDescriptor, FilterDescriptor, and CompositeFilterDescriptor.  They seem to have similar fields to those shown above, but they aren't binding when I try to use them as input to my Action method.  I haven't had any luck finding a similar thread or any documentation around this.

    Again, my end goal is to have cascading comboboxes without losing the ability to filter by text entered, so if there's any advise there, I'm all ears.  Also, any advice on how to bind the posted filter info is welcome.

    Also, here's the definition of my comboboxes as a side note:
                <td class="formTableLabel">Price Publisher: </td>
                        .HtmlAttributes(new { required = "required", validationMessage = "Please select an option." }))
                <td class="formTableLabel">Price Instrument: </td>
                        .DataSource(source =>
                            source.Read(read =>
                                read.Action("GetPriceInstrumentList", "TradeEntry").Data("priceInstrumentListJSON").Type(HttpVerbs.Post);
                        .HtmlAttributes(new { required = "required", validationMessage = "Please select an option." }))
  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 30 Jan 2013 Link to this post

    Hello Evan,

    I already posted an answer in the support ticket you opened. For reference I will paste the answer here. Feel free to continue our conversation here or in the support ticket.


    What exactly did you try to handle the server side filtering, could you share some code? 

    Basically server filtering with cascading ComboBoxes is covered in this demo. Also you can send the values in your own format like covered in this part of the documentation. Or you can use the change event and perform for the child combo manually.


    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top