Copy / paste

Compatibility with any spreadsheet

Copy paste functionality of ParamQuery grid is compatible with any spreadsheet application like MS Excel i.e., data can be copied from ParamQuery Grid and pasted to other spreadsheets and vice versa.

Keyboard operations:

Ctrl A: Select All cells.
Ctrl C: Copy selection which is available for paste.
Ctrl X: Cut selection which is available for paste.
Delete: Delete selection.
Ctrl V: Paste data.
Ctrl Z: Undo
Ctrl Y: Redo

Please note:

Skip rows / columns from copied data

By default all the rows and columns in a Range or Selection of cells are copied. Columns can be skipped from copied data by setting column.copy to false. Similarly rows can be skipped from copied data by setting pq_copy property to false.

Sometimes it's required to skip hidden rows and columns while copying. To ahieve that, column.copy can be linked to column.hidden property by using javascript getters which can be defined in the grid initialization object. We use columnTemplate to propagate copy property to all columns.

columnTemplate: {
    get copy(){           
        return !this.hidden;
    }
}

or by updating existing grid initialization object (before initialization of grid)

Object.defineProperty(obj.columnTemplate, 'copy', {
    enumerable: true,
    get (){           
        return !this.hidden;
    }
})

Similarly it can be set up for rows by using their counterpart properties, rowTemplate, rowData.pq_hidden, rowData.pq_copy.

Skip rows / columns when pasting data

By default all the target rows and columns are pasted over by copied data. Target columns can be skipped by setting column.paste to false. Similarly target rows can be skipped by setting pq_paste property to false.

Sometimes it's required to skip hidden rows and columns in the target Range/Selection while pasting. To ahieve that, column.paste can be linked to column.hidden property by using javascript getters which can be defined in the grid initialization object. We use columnTemplate to propagate paste property to all columns.

columnTemplate: {
    get paste(){           
        return !this.hidden;
    }
}

or by updating existing grid initialization object (before initialization of grid)

Object.defineProperty(obj.columnTemplate, 'paste', {
    enumerable: true,
    get (){           
        return !this.hidden;
    }
})

Similarly it can be set up for rows by using their counterpart properties, rowTemplate, rowData.pq_hidden, rowData.pq_paste.