Filter on combobox lookup column not working

8 posts, 0 answers
  1. Ariel
    Ariel avatar
    4 posts
    Member since:
    Sep 2014

    Posted 31 Mar 2015 Link to this post

    Hi everyone,

    I have a Telerik mvc grid with filter mode set to “GridFilterMode.Row”.
    One of the columns is a lookupComboBox modified from this example: http://www.telerik.com/support/code-library/grid-editing-using-combobox-with-remote-binding-and-filtering


    Now, the filtering capability for the lookupcombobox does not work at all, please see attached image for details. Same issue can be seen in the example provided by Telerik (see link above).

    Has anyone seen this issue? Any ideas on how to get the filter to work properly with the lookupcombobox?

    Thanks  
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3748 posts

    Posted 02 Apr 2015 Link to this post

    Hello Ariel,

    Would it be possible to share more information about the current implementation, that will help us to observe the depicted erroneous behavior locally? This will help us to review the problem locally and narrow the problem down much faster. A runnable test demo will be of a great help too.

    Regards,
    Georgi Krustev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. Ariel
    Ariel avatar
    4 posts
    Member since:
    Sep 2014

    Posted 02 Apr 2015 Link to this post

    Hi Georgi sure that will be great I can run a test demo if you want. My office phone number is (954)628-0755, give a quick call and we can coordinate details

    -Ariel 
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3748 posts

    Posted 03 Apr 2015 Link to this post

    Hello Ariel,

    I answered to the support ticket opened on the same subject. I would like to ask you to continue our discussion in only one thread to avoid duplication. Thank you for the understanding.

    Here is quote of the answer:

    I further investigate the case and I can clarify that the described behavior is expected. The field related to the column in question is an object. In this case, the filter row or the filter menu will not be able to generate a filter widget, as they cannot know how to treat an object filtration. This is applicable to the server filtering too. The send filter expression tries to filter an object by string value, which is unsupported scenario.

    With regards to the server filtering, one possible option is to modify the send filter expression in a such way that it will filter a particular field of that object and not the whole object. 

    With regards to the filter menu and row, you will need to create a custom filter menu in order to handle the object filtration scenario. Please check this online demo for more details. For filter row, you can define custom template too:
    .Columns(columns =>
        columns.Bound(o => o.OrderDate)
        .Filterable(filterable =>
            filterable.Cell(cell =>
                cell.Template("customTemplate")
                )
            )
        )
    )
    Here is a Dojo demo that demonstrates the expected outcome.

    Regards,
    Georgi Krustev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  5. Ariel
    Ariel avatar
    4 posts
    Member since:
    Sep 2014

    Posted 16 Apr 2015 in reply to Georgi Krustev Link to this post

    Georgi,

    Thanks for the reply.Using your example, I was able to implement the “kendoComboBox”; however, I need to pass a “text” as a method parameter to the controller to make the combobox work.  So, how can I pass the text input to the controller? 

    columns.Bound(q => q.Vendor).ClientTemplate("#: data.Vendor ? data.Vendor.Name : '[None]' #") .EditorTemplateName("ComboBoxLookup_Vendor")
    .Filterable(filterable => filterable.Cell(cell => cell.Template("vendorFilter"))).Width(200);

    function vendorFilter(container) {
                container.element.kendoComboBox({
                    name: "vendors",
                    dataTextField: "Name",
                    dataValueField: "VendorID",
                    placeholder: "Select a vendor",
                    autoBind: false,
                    dataSource: {
                        transport: {
                            read: "@Url.Action("_GetVendors", "Quote")",
                        },
                        serverFiltering: false
                    },
                });
            }

    Controller:

    public ActionResult _GetVendors(string text)

     

    Thanks

  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3748 posts

    Posted 20 Apr 2015 Link to this post

    Hello Ariel,

    I would suggest you check the ComboBox overview help topic, which explains how to send additional values to the server. You can also refer to this code library, which uses this approach in action.

    Regards,
    Georgi Krustev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  7. Ariel
    Ariel avatar
    4 posts
    Member since:
    Sep 2014

    Posted 20 Apr 2015 in reply to Georgi Krustev Link to this post

    Georgi,

     The your examples use s

    .DataSource(source => { source.Read(read => read.Action("GetProducts", "Home").Data("onAdditionalData"); }); })

     I am using:

    dataSource: { transport: { read: "@Url.Action("_GetVendors", "Quote")" }, },

     

    Do you have an example I can look at using this approach? thanks

     

     

  8. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3748 posts

    Posted 22 Apr 2015 Link to this post

    Hello Ariel,

    Based on the given information, I suppose that you are skipping the ASP.NET MVC wrapper and initialize the widget instead using JavaScript. If this is the case, then note that the server wrapper actually produces JavaScript initialization script similar to one that you have written.

    We do not have demo similar to the shared code library only using JavaScript, but it produces JavaScript initialization scripts that you can use to accomplish your goal.

    If the problem still persists, please send us a simple repro demo that depicts the issue. This will help us to review the problem locally and advice you further much faster.

    Regards,
    Georgi Krustev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top