Overview

This guide is meant to assist in upgrading from ParamQuery Pro 3.1.0 or 3.0.0 to ParamQuery Pro 3.2.0. All changes which are impacted by upgrade are listed below, along with how to upgrade your code. For new features please refer the changeLog included in the SDK.

General Changes

  1. Context of general and event based callbacks has been changed from DOM reference to widget instance. So instead of writing $(this).pqGrid( 'method_name', params );, you can directly write this.method_name( params ); inside the callbacks.

  2. Event names have been changed to widgetName:eventName. e.g., to listen to DOM based beforeSort event of grid, the new syntax is $( selector ).on( "pqGrid:beforeSort", .. ) instead of $( selector ).on( "pqgridbeforesort", .. )

  3. Firing of DOM based events and their bubbling have been disabled by default for performance reasons. Firing of DOM events can be enabled by setting the option trigger: true of the widget. Similarly bubbling of DOM events can be enabled by setting the option bubble: true of the widget.

  4. This version introduces new lightweight events which are faster and easy to use. Equivalent syntax to listen to beforeSort event is instance.on( 'beforeSort', function( evt, ui ){ } ) . We recommend to use these events unless necessary otherwise.

Grid

checkbox columns

Checkbox columns have been revamped in this version to support their use in transactional editing, support validations, display disabled checkboxes and to support overriding their default rendering with column.render and header cell rendering. There have been following changes in the API.
  1. The name checkBoxSelection has been changed to checkbox
  2. column.editor has to be set to false instead of column.editable.
  3. beforeunCheck and unCheck events have been removed. Instead beforeCheck and check events are fired during both unchecking and checking.
  4. There is no need to return false in change event to prevent selection of rows. Instead selection of rows can be controlled by the boolean property cb.select
  5. column.dataType is mandatory for checkbox columns unless it's a string dataType.
  6. checkbox columns are not compatible with IE <= 8.

Selections

Selections have also received significant upgrades in this version to support column selections, make them fast and easy to manipulate. As a result some methods have been removed from factory selection method as noted in the API and two new prototype based objects Range and Selection have been introduced.

Support to maintain cell selections upon data changes in the grid and to select non-contiguous areas of cells has been dropped.

addRow, updateRow and deleteRow

These 3 methods now support multiple rows so that multiple rows can be added, updated, deleted through a single method call.

Validations

It's important to pass focusInvalid: true to isValid() method when it's required to stop further validation and focus on first invalid cell.

New namespace

There is a new global namespace i.e., pq used by the PQ library and widget instances can be created using constructors available on this namespace. e.g., var instance = pq.grid( ".selector", options ); So due care should be taken not to overwrite the namespace.