ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: p38 on September 07, 2021, 03:48:55 am

Title: Prevent from adding new rows when pasting data.
Post by: p38 on September 07, 2021, 03:48:55 am
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.
Title: Re: Prevent from adding new rows when pasting data.
Post by: p38 on September 10, 2021, 09:54:07 pm
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.
Title: Re: Prevent from adding new rows when pasting data.
Post by: paramvir on April 29, 2025, 10:57:16 pm
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