Skip to content

Global Filters not Working #31

@rileybwesley

Description

@rileybwesley

I noticed the global filters are not working. Made a quick work around to handle:

        protected virtual void ProvisionGlobalSearchPayload(ref TableFilterModel tableFilterPayload, string[] props)
        {
            if (!tableFilterPayload.Filters.ContainsKey("global"))
                return;
            foreach (var prop in props)
            {
                var value = (tableFilterPayload.Filters["global"] as JObject)["value"];
                var matchMode = (tableFilterPayload.Filters["global"] as JObject)["matchMode"];
                if (tableFilterPayload.Filters.ContainsKey(prop))
                {
                    tableFilterPayload.Filters[prop] = new JArray { new JObject
                    {
                        ["value"] = value,
                        ["matchMode"] = matchMode,
                        ["operator"] = "or"
                    }};
                }
                else
                {
                    tableFilterPayload.Filters.Add(prop, new JObject
                    {
                        ["value"] = value,
                        ["matchMode"] = matchMode,
                        ["operator"] = "or"
                    });
                }
            }
            tableFilterPayload.Filters.Remove("global");
        }

Forces you to define global filters on serverside but seems to work nice :)

Might be able to use this to work it into the library...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions