A predefined set a validation rules allow you to quickly set certain requirements on the entered data. Here’s how easily we can set two validation rules (NonEmptyValidator and MaximumLengthValidator) for one field, where the first rules does not allow empty value and the second rules restricts the data to 12 characters at most:

The values entered in the DataForm can be submitted to the underlying data object on three different occasions, using the commitMode property of the DataForm:

dataform.commitMode = dataFormModule.CommitMode.Immediate;

The available modes are:

Immediate. The value is reflected on the underlying data object as the end-user edits the value of a property.

OnLostFocus. The value is reflected on the underlying data object when the editor loses focus.

Manual. The value(s) is reflected on the underlying object on the a call of the commitAll function.

Accessing the editor

A few useful editor APIs made their way to the first official version of the DataForm component. We understand that the default look and feel of the editors may not always suite your app look and feel or regional settings. Therefore, we exposed an event editorUpdate which is called as the editor appears. Here’s how to change the formatting of the datetime editor value and to set some spacing between the updown buttons and the displayed value:

Now that the DataForm is official, the next steps is to enable it to Angular 2. You may expect that to happen in one of our next versions.

A few more things to mention

A release compatible with the official Angular 2 and NativeScript 2.3

Just to mention it, and you should not be surprised, that we are compatible with the official Angular 2 which came out just a day before our release. So, you can expect our Angular 2 enabled components to work flawlessly with the official Angular 2. And of course, our components are built for the latest NativeScript 2.3

Enterprise

Stay connected with NativeScript

I agree to receive email communications from Progress Software or its Partners, containing information about Progress Software’s products. Consent may be withdrawn at any time.

We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.

Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.