ParamQuery Grid API Documentation for Version 3.3.x - 3.5.x (GPL v3)

Range

Range is an object that represents a collection of rectangular areas or regions in the grid and helps in collective manipulation of the cells lying within the range. A new instance is created and returned by calling range method of the grid and its parameter is an object that takes at least one property and at the maximum 4 properties out of r1, c1, r2, c2, rc, cc where r1 is rowIndx of first row, c1 is colIndx of first column, r2 is rowIndx of last row, c2 is colIndx of last row, rc is row count or number of rows, cc is number of columns in the range.

var range = grid.range( { r1: 2 } ) to create range of single row.
var range = grid.range( { r1: 2, r2: 4 } ) to create range of 3 rows.
var range = grid.range( { r1: 2, rc: 2 } ) to create range of 2 rows.
var range = grid.range( { r1: 2, c1: 3 } ) to create range of single cell.
var range = grid.range( { c1: 2, c2: 4 } ) to create range of 3 columns.
var range = grid.range( { c1: 2, cc: 4 } ) to create range of 4 columns.
var range = grid.range( { r1: 2, c1: 2, r2: 5, c2: 4 } ) to create block range.

MethodParameters Returned TypeDescription
address Array It returns an array of plain objects having the properties r1, c1, r2, c2, type where r1 is rowIndx of the initial row, r2 is rowIndx of last row, c1 is colIndx of first column, c2 is last column in the range and type is a string having these possible values: row, cell, column, block
add Object It adds a collection of cells { r1: r1, c1: c1, r2: r2, c2: c2 } to an existing range. There should not be any overlap or duplicate in the new collection with existing collections in the range.
indexOf range Integer It finds the index of a single range in the collection of ranges if the range lies within or is exactly the same as any other range.
cut dest (optional) It cuts or empties the contents of cells lying within the range The removed content can be used later on with paste. The removed content is immediately pasted to destination range when dest parameter is specified. e.g., grid.range( { c1: 0 } ).cut( { dest: { c1: 2 } ) cuts the content of 1st column from left and pastes it onto the 3rd column from left.
copy dest (optional) It copies the contents of cells lying within the range. The copied content can be used later on with paste. The copied content is immediately pasted to destination range when dest parameter is specified. e.g., grid.range( { c1: 0 } ).copy( { dest: { c1: 2 } ) copies the content of 1st column from left and pastes it onto the 3rd column from left.
clear It clears or removes the contents of cells lying within the range.
count Integer It returns the number of cells within the range.
merge refresh (optional) It merges all the cells lying in the range into a single cell. Added in v3.3.0
select It selects all the rows or cells lying within the range after removing previous selections if any.
unmerge refresh (optional) It unmerges the top left merged cell if any lying in the range. Added in v3.3.0
value val (optional) Array Gets or sets the value of cells in a range. It sets given value of all the cells lying within the range. It gets the value of first cell in the range when the parameter is not provided. Since v3.4.0, it uses 2 dimensional array to get or set value of all cells in the range.
//setter
grid.range({r1:0, c1:0, rc:2, cc:2}).value(
[
    ['a', 1],
    ['b', 2]
]);

//getter
var val = grid.range({r1:0, c1:0, rc:2, cc:2}).value();
Selection

Selection is an object derived from Range and hence has all the methods of Range available to it. It is similar to Range except that every grid has only one instance of Selection object and this instance can be obtained by calling selection method of the grid where selection instance represents all the selected rows, cells and columns in a grid.

var selection = grid.selection().

The same instance is also available as ui property in the selectChange event that fires whenever there is a change in selection state of the grid.

MethodParameters Returned TypeDescription
removeAll type It deselects all the rows and cells in the grid.
selectAll type, all It selects all the rows or cells in the grid depending upon value of type parameter which has 2 possible values: 'row' and cell'. 'row' is the default value of type.
all has 2 possible values: true or false. All the rows/cells are selected when all is true, while only rows/cells on current page are selected when all is false.
Options
Methods
Events
Utility Methods