After Data item change, filter does not operate

4 posts, 0 answers
  1. Porsha
    Porsha avatar
    2 posts
    Member since:
    Oct 2019

    Posted 25 Jun 2020 Link to this post

    Hi,

     

    I've updated several items within two of the column fields in my kendo grid.  Of course, the data is pulled from a DB via a stored procedure in Entity Framework.

    I am using the multi - true and search - true attributes for the filterable option in my grid.  The new values are there; however, when I select a value, it does not filter.  If I use just filterable: true without the multi feature, it does in fact filter.

    I've tried to to reset using the setDataSource method and numerous other methods.  Is there a way to reset or perhaps clear the old values.

    Thank you

  2. Georgi
    Admin
    Georgi avatar
    698 posts

    Posted 29 Jun 2020 Link to this post

    Hi Porsha,

    Are you using server filtering? If you do, could you please make sure that the correct value is submitted with the filter request?

    Furthermore, could you share your configuration with us? Or even better a small sample where the issue replicates?

    Regards,
    Georgi
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  3. Porsha
    Porsha avatar
    2 posts
    Member since:
    Oct 2019

    Posted 29 Jun 2020 in reply to Georgi Link to this post

    I am not using server filtering.  

     

    Here is the implication of it.

    https://dph1.adph.state.al.us/alchronicresources (production environment)

    If you try filtering via FacilityType and/or ProgramType, no results are returned.

    So I was able to create a fix for it in my test environment, but not sure how accurate it is because it does not persist the filter selection after I hit the Filter button.  However, it does filter and return results, but the users is unable to see what selection was made..

     

    Here is the current code where the filtering semi works..

    $("#grid2").kendoGrid({
                    //rowTemplate: $("#rowTemplate").html(),
                    //altRowTemplate: $("#altRowTemplate").html(),
                    filter: 
                        function (e) {
                            if (e.filter != null) {      
                                e.filter.filters.forEach(function (f) {
                                f.operator = "contains";
                            });                      
                               
                              }                    
                      },
                    selectable: true,
                    change: onChange,
                    dataSource:
                    {
                        ds
                    },

                    filterable:
                    {
                        multi: true,
                        search: true
                    },

                    columns: [
                        {
                            field: "FacilityName",
                            title: "Facility Name"
                        },
                        {
                            field: "Address",
                            title: "Address"

                        }, {
                            field: "City",
                            title: "City"
                        }, {
                            field: "County",
                            title: "County"
                        },
                        {
                            field: "District",
                            title: "District"
                        },
                        {
                            field: "Zip",
                            title: "Zip Code"
                        }, {
                            field: "PhoneNumber",
                            title: "Phone Number"
                        }
                        , {
                            field: "FacilityTypeName",
                            title: "Facility Type"
                        }
                        , {
                            field: "ProgramTypename",
                            title: "Program Type"
                        }
                        //, {
                        //    field: "GroupType",
                        //    title: "Group Type"
                        //}
                    ],


                    scrollable:
                        true
                    //{
                    //    virtual: true
                    //}
                    ,
                    height: 500,
                    sortable: true,
                    pageable: {
                        pageSize: 5,
                        pageSizes: true
                    },
                    groupable: true,
                    editable: false,
                    columnMenu: true,

                    excel: {
                        fileName: "ALChronicResources.xlsx",
                        filterable: true,
                        allPages: true
                    },

                    columnMenuInit: function (e) {
                        var multiCheck = this.thead.find("[data-field=" + e.field + "]").data("kendoColumnMenu").filterMenu.checkBoxAll;
                        if (multiCheck) {
                            var filterMultiCheck = this.thead.find("[data-field=" + e.field + "]").data("kendoColumnMenu").filterMenu
                            filterMultiCheck.container.empty();
                            filterMultiCheck.checkSource.sort({ field: e.field, dir: "asc" });
                            filterMultiCheck.checkSource.data(filterMultiCheck.checkSource.view().toJSON());
                            filterMultiCheck.createCheckBoxes();
                        }
                    },

                    pdf:
                    {
                        fileName: "ALChronicResources.pdf",
                        allPages: true,
                        avoidLinks: false,
                        landscape: true,
                        margin: { top: "2cm", left: "1cm", right: "1cm", bottom: "1cm" },
                        paperSize: "A4",
                        repeatHeaders: true,
                        scale: 0.3,
                        template: $("#page-template").html(),
                        title: "AL Public Health Chronic Disease Support and Resources"
                    }
                    //persistSelection: true

                });                          

  4. Georgi
    Admin
    Georgi avatar
    698 posts

    Posted 01 Jul 2020 Link to this post

    Hi Porsha,

    Thank you for the provided url to your production app, unfortunately I am not able to open it, I assume that the app is not public.

    Nevertheless, I tried to replicate the behavior using similar configuration to the provided. However, it seems to work correctly even with newly created items. You can find the sample I used for testing in the link below:

    Could you please examine it and let me know what I am missing?

    Regards,
    Georgi
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top