ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: rgorantla on September 23, 2014, 08:41:10 pm
-
Hi,
First time when you copy and paste multiple rows and columns it is working fine.
When you click addnewrow - and try to paste i am receivign an error
"Uncaught primary key violation"
-
This error is thrown when there is a duplicate value of primary key in a grid.
Please point out in which demo do you get this error?
-
Sorry, that was my mistake - i put recIndx as name and trying to copy paste same names- So was receiving this error.
But have another issue -
I have no rows , clicked on add new row - 3 times - i have 3 rows now.
Copied just 1 row in excel and tied to paste it - instead of pasting it in 1 row , it is pasting in all rows.
I did change add row function : because we just want to select the cell not to go to edit mode. - Could you please help me on whats am i doing wrong
{
type: 'button', icon: 'ui-icon-plus', label: 'New Plan', listener:
{
"click": function (evt, ui) {
//append empty row at the end.
var rowData = {};// UnitPrice: 1, ProductID: 34, UnitPrice: 0.2 }; //empty row
var rowIndx = $grid.pqGrid("addRow", { rowData: rowData, checkEditable: true });
$grid.pqGrid("goToPage", { rowIndx: rowIndx });
// $grid.pqGrid("editFirstCellInRow", { rowIndx: rowIndx });
$grid.pqGrid("setSelection", { rowIndx: rowIndx, colIndx: 1 });
}
}
}
-
It's because of the selection. Paste takes place in all the selected rows or in rows having first selected cell.
-
No, its happenign even if i dotn have setselection
var rowIndx = $grid.pqGrid("addRow", { rowData: rowData, checkEditable: true });
// console.log(rowIndx);
$grid.pqGrid("goToPage", { rowIndx: rowIndx });
$grid.pqGrid("editFirstCellInRow", { rowIndx: rowIndx });
-
I don't see this happening in this demo (which has same code )
http://paramquery.com/pro/demos/editing_instant
-
It is happenign in your demo too.
Click on add new product : and try to paste some values (lets say row 19)
and then click add new row again (rows 20,21) for mutliple times or once- since it is in edit mode - do a escape button to come out of that cell and paste - it is pasting in the the row 19 not in 20,21
-
Paste takes place only on the contiguous selected rows / cells.
If row 19 is selected, paste would take place on row 19 even if you add new rows i.e. 20, 21, etc.
-
Though we are on row 22 ,click escape button - doesnt it should select that paricular row (22)? isntead of 19 ?
I need to click twice or thrice to select roww 22 inorder to paste
-
if you want selections to remain in sync with newly added row, please use setSelection as shown in this demo
http://paramquery.com/pro/demos/editing_instant
-
Thanks , that worked.