Author Topic: Block users from adding new rows by copy and pasting data.  (Read 1809 times)

altyra

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 12
    • View Profile
Block users from adding new rows by copy and pasting data.
« 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

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Block users from adding new rows by copy and pasting data.
« Reply #1 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.