ag-grid-odata icon indicating copy to clipboard operation
ag-grid-odata copied to clipboard

BUG: Filter can't handle special characters (eg. &)

Open jornhd opened this issue 4 months ago • 0 comments

When filtering with values containing special characters it might fail. You should encode values for use in uri when building the query string. Suggestion for change in toQuery:

        if (options.sort && options.sort.length > 0) {
            path.push("$orderby=" + encodeURIComponent(options.sort.join(",")));
        }
        if (options.filter && options.filter.length > 0) {
            path.push("$filter=" + encodeURIComponent(options.filter.join(" and ")));
        }
        if (options.apply && options.apply.length > 0) {
            path.push("$apply=" + encodeURIComponent(options.apply.join("/")));
        }
        if (options.expand && options.expand.length > 0) {
            path.push("$expand=" + encodeURIComponent(options.expand.join(",")));
        }
        if (options.select && options.select.length > 0) {
            path.push("$select=" + encodeURIComponent(options.select.join(",")));
        }

jornhd avatar Oct 17 '24 14:10 jornhd