Overview

This guide is meant to assist in upgrading from ParamQuery Pro v10.x to v11.x. Only changes which are impacted by upgrade are listed below, along with how to upgrade your code. For new features please refer the API and demos.

General Changes

  • Asynchronous API Enhancements: Several existing APIs for grid import, export, clear, copy, paste are now asynchronous. This change provides compatibility with newer versions of jszip (> 2.5) and enables support for advanced features like image export, import, copy, paste to clipboard etc.
    It ensures the browser UI stays responsive and avoids hangs during time-consuming processes.
  • New Rich Objects: The update introduces Rich objects in cells to enable seamless integration of encapsulated content across key grid operations—including rendering, editing, export, import, copy, and paste. These objects help maintain data fidelity and simplify custom cell logic.

Asynchronous API

Recent PQGrid updates have changed several methods—such as grid.exportData(), grid.importWb(), and Range.copy()— to be asynchronous. These methods now return Promise objects instead of direct values.

To ensure proper sequencing and compatibility with modern JavaScript, you should use the async/await pattern. For example:

async function exportData() {
  const exportedData = await grid.exportData({ ... });
  pq.saveAs(exportedData, "filename.xyz");
}

✅ This ensures the code waits until exportData() finishes before proceeding.

Previously, the same code was written synchronously:

function exportData() {
  const exportedData = grid.exportData({ ... });
  pq.saveAs(exportedData, "filename.xyz");
}

⚠️ In the latest version, this synchronous approach will no longer work correctly because exportData() now returns a Promise.


Rich Objects

Rich objects have been introduced in this version of PQGrid to support specialized, non-primitive cell content such as images, hyperlinks, and custom widgets. Unlike primitive types—string, number, boolean, or Date— rich objects require additional lifecycle handling. This is especially important for grid operations like copy, paste, export, or import, which depend on predictable serialization and rendering.

Structurally, rich objects are plain JavaScript objects that implement specific interface methods for different lifecycle operations. These typically include:

  • Custom rendering logic inside grid cells
  • Import/export handling for CSV, XLSX, PDF, or HTML
  • Clipboard support for custom copy–paste interactions

For compatibility with hyperlinks defined in earlier versions using rowData.pq_cellprop, you must now include an additional property: inst: 'Link'. This signals PQGrid to use the built-in hyperlink lifecycle logic:

rowData.pq_cellprop[dataIndx] = { 
  link: "http://...", 
  inst: "Link" // Required for compatibility with the new rich object system 
};

✅ With inst: 'Link', hyperlinks behave as fully supported rich objects across rendering, export, and clipboard operations.


Validations

In the latest version, PQGrid changed how validation works:

  • Earlier, all validation rules (like minLen, maxLen, regex, range, etc.) applied even if the field was empty.
  • Now, they only apply if the field has a defined value.
  • If you want to make a field mandatory, you must explicitly add the nonEmpty condition.

✅ Example: Required + Minimum Length

colModel: [
  {
    title: "Name",
    dataIndx: "name",
    validations: [
      { type: 'nonEmpty', msg: "Name is required" },   // required
      { type: 'minLen', value: 3, msg: "At least 3 characters" } // only applies if not empty
    ]
  }
]

Note: Without nonEmpty, the field could be left blank, and minLen won’t trigger anymore.

🔑 Key Upgrade Step:

Always add { type: 'nonEmpty' } when a field must not be blank.
Other conditions now only validate non-empty values.