Skip to content

jQuery 4: $.trim is not a function in igDataSource, igHtmlEditor and the loader #2302

Closed

Description

@ChronosSF

Description

jQuery 4.0 removed jQuery.trim, which jQuery 3.5 had deprecated. Ignite UI still calls $.trim in 19 places, so with jQuery 4 these code paths throw TypeError: $.trim is not a function. In $.ig.DataSource this breaks binding to a remote URL and local filtering, and with them every control that binds through the data source.

The calls on master (026d3ff):

  • src/js/modules/infragistics.datasource.js: lines 2105 (analyzeDataSource), 4012, 4500, 5774, 6212, 6217, 6218, 6222, 6232, 6234, 6236, 6252, 6360 (_findMatch) and 8285
  • src/js/modules/infragistics.ui.htmleditor.js: lines 1958 and 1963 (_viewSource)
  • src/js/infragistics.loader.js: lines 2383, 2527 and 2539
  • ignite-ui version: master (026d3ff)
  • browser: Chromium (not browser-specific)
  • jQuery: 4.1.0. The same code works with jQuery 3.8.0.

Steps to reproduce

  1. Load jQuery 4.x and the Ignite UI data source.
  2. Run:
// Remote data: fails in analyzeDataSource
new $.ig.DataSource({ dataSource: "/api/products", responseDataKey: "d.results" }).dataBind();

// Local filtering: fails in _findMatch
var ds = new $.ig.DataSource({
    dataSource: [{ ID: 1 }, { ID: 2 }, { ID: 3 }],
    schema: { fields: [{ name: "ID", type: "number" }] }
});
ds.dataBind();
ds.filter([{ fieldName: "ID", expr: 2, cond: "greaterThan" }], "AND", true);

Result

Both calls throw TypeError: $.trim is not a function.

Expected result

The same as with jQuery 3.x: the first data source binds without an error, and after the filter ds.dataView() holds only the record with ID 3.

Suggested fix

Replace every $.trim(x) with code that behaves the same on every supported jQuery version, including the way $.trim handles null and undefined (it returns ""):

x == null ? "" : String(x).trim()

A small helper in infragistics.util.js (for example $.ig.util.trim) keeps the call sites short, and also gives the consistent trim calls that #2007 asked for.

Attachments

None.

Activity

  1. added a commit that references this issue on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions