Avoid exceeding certain number of duplicates
Avoid exceeding certain number of duplicates
Manuel Perez
Posts: 1Questions: 1Answers: 0
in General
Hi,
I'm new at code developing and I want to know if you can help me.
Is there a way to achieve avoiding to create a new register using datatables when the value has repeated a certain number of times (lets say 3 times). This is because I want to allow to use a referal ID no more than this number of times.
This discussion has been closed.
Answers
Assuming that you are using Editor, you would need to create a custom validator. The provided database validator only checks for duplicates. In your case you'd need to select the count of the matching number of rows.
Regards,
Allan
Hi @Manuel Perez ,
You can use the API call
row().delete()to delete rows once the table has been initialised, or you could use jQuery and remove it from the DOM.Hope that helps,
Cheers,
Colin