Editable table column only when adding new row

In the table component, I want the primary key column to only be editable when adding a new row. Existing primary keys should not be allowed to change. How can I achieve this? I have tried using the restrict editable field with a check on "_.isUndefined(currentRow)" or things similar to this but none of them worked.


1 Like

Hey @nshi!

Great question, I'm not certain if there is a way to do this with the native add row UI but this should definitely be achievable using an external form to add rows. Do you think this could work for your use case here?

Thanks @Chris-Thompson. Yes, that's the workaround I'm using but the UI gets a bit complicated. It'd be really nice if adding row directly in the table is possible in the near future.

I found this one will work.
using restrict editing with "{{!userTable.newRow}}"