General Category > Help for ParamQuery Grid (free version)

Prevent from adding new rows when pasting data.

(1/1)

p38:
Is there anyway to block pqgrid from adding new rows if they paste a number of rows greater than current rowcount?

I find that pasting data inserts extra row if the paste data is more then the row count.

eg: if I have 10 rows and I paste 15 rows, pqgrids adds another 5 rows. 

I cant find anywhere a setting to limit adding new rows.

for example a maxRowCount and maxColCount would be handy to have, if set, wont allow pqgrids to add more rows/columns than these values.

Many thanks.

p38:
Hi Admin, any feedback perhaps?

I am of the opinion this is a bug, if one sets the max rows, and you try and paste more than the max rows, it should not allow this, or alternatively there should be a setting to allow this.

paramvir:
Sorry for late reply.

It can be done in beforeValidate, check if ui.source == 'paste' and there are objects of type: 'add' in ui.rowList, then remove them.

https://paramquery.com/api#event-beforeValidate

Navigation

[0] Message Index

Go to full version