ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: Punit on July 07, 2022, 12:53:00 pm

Title: Copy From Excel On Sheet2 not working
Post by: Punit on July 07, 2022, 12:53:00 pm
Dear Team,
We try to copy from sheet 2 but we always get the value of sheet 1. We write the below code to copy from 1 grid and paste it to another grid. Is there any alternate way to achieve this? Also if we copy a value from sheet 2 and copy this value to the clipboard then it works fine in local but not in production.


var $grid = $('#spreadsheet').closest(".pq-grid");
 $grid.pqGrid("copy");

var $grid1 = $('#tree_grid').closest(".pq-grid");
$grid1.pqGrid("paste");
Title: Re: Copy From Excel On Sheet2 not working
Post by: paramvir on July 07, 2022, 02:39:55 pm
use Tab API to work with worksheets.

If you want to copy from sheet2, then activate and focus on sheet2 and then copy from it.

Code: [Select]
var T = this.Tab();
T.activate(1); //assuming sheet2 is at 1 index in tabs array collection.
var grid2 = T.grid( T.activeTab());
grid2.focus({rowIndxPage: 1, colIndx: 1});
grid2.Range({r1:1,c1:1, rc:2,cc:2}).copy();