DataTable-AltEditor
DataTable-AltEditor copied to clipboard
Unique constraint not working in this instance
I have the user uploading a templated CSV of harddrive data (serial numbers, models, makes, etc). When uploading, I convert the CSV file into a client side datatable and I parse the data and highlight the rows with duplicate serial numbers.
When they go to edit the line to fix the duplicate serial number, when I have the unique constraint on the field, it still allows it to be submitted even though there already exists another row with that same serial number when the data is not changed. When I choose another serial number that is not marked in duplication, it correctly stops and says 'Duplicate detected'.
Do you have any suggestions as to how to get this to work the way I want it to?