ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: altyra on October 25, 2019, 05:36:13 pm

Title: Block users from adding new rows by copy and pasting data.
Post by: altyra on October 25, 2019, 05:36:13 pm
I am  having  a problem, is there anyway to block the user from adding new rows if they copy and paste a number of rows greater then a i already have in the table itself. For example if i have 8 rows and the user adds 12 from an external excel i want to still only have 8 rows.

Thank you for time
Title: Re: Block users from adding new rows by copy and pasting data.
Post by: paramvir on October 25, 2019, 05:47:07 pm
beforeValidate event can be used to do any customization of pasted data.

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

In your case you can remove the extra rows from ui.addList or ui.updateList by using normal js array manipulation methods.