DataTable bound to form, detect new record?

Hi

I have a datatable, with a form that opens in a popup for editing records from the datatable.

If I want to insert a new record into the datatable, I first unselect everything from the datatable, and then opens the form.
Now I can type in a new record.

But the form need some of its inputs, that are disabled when editing a record, to be enabled when adding a new record.

How can this be done? From inside the form, detect if the bound record from the datatable is a new one?

You can check form.getValues().id
It will point to some non-empty values in case of already existing record. And it will not be defined for the new record. ( you can use onValues event, to modify the form after data loading )