As we discussed in today's meeting, two situations need to be distinguished when a file is imported:
One case is when the data was exported from the MongoDB by the administrators and they want to use the app to check the consistency of some rows of the table. In that case, the table contains an _in field (column). If there is an _id column, the user must be forbidden to edit it. I believe the correct way to do this is preferably to hide the _id field altogether by adding the type="hidden" attribute to the input fields that belong to the _id column in the table. If the table contains an _id field, the "Add new line" button should also be hidden, since in this special situation we can assume that the admins only want to validate and correct existing lines and not add further lines. Obviously, there is also the problem that we couldn't generate an _id for the new line anyway.
The second case is that the csv or Excel table that is being imported does not come from the database. In that case it does not contain an _id column. We want it simply to import the table with the existing fields and not add an _id field to it at all, neither when it is opened, nor when it is saved.
As we discussed in today's meeting, two situations need to be distinguished when a file is imported:
_in
field (column). If there is an_id
column, the user must be forbidden to edit it. I believe the correct way to do this is preferably to hide the_id
field altogether by adding thetype="hidden"
attribute to theinput
fields that belong to the_id
column in the table. If the table contains an_id
field, the "Add new line" button should also be hidden, since in this special situation we can assume that the admins only want to validate and correct existing lines and not add further lines. Obviously, there is also the problem that we couldn't generate an_id
for the new line anyway._id
column. We want it simply to import the table with the existing fields and not add an_id
field to it at all, neither when it is opened, nor when it is saved.