These adapters are used to adapt Grid Model interface to Form Model interface, so that you can pass a grid model instance into a form service and create or update grid records by means of a form controlled by that form service.
An adapter that converts the passed Grid Model into Form Model for creating new records of the grid on a separate form.
Parameters:
Type | Name | Description |
---|---|---|
GridModel | model | Required. The instance of a Grid model |
Object | initialData | Optional. Initial form data in the next format {‘field1’: ‘value1’, ‘field2’: ‘value2’, …} |
Returns: new object with interface similar to Form Model.
Create a new record
in the grid.
Parameters:
Type | Name | Description |
---|---|---|
Object | record | Required. Record to be created in the grid. It is expected to be in the next format {‘field1’: ‘value1’, ‘field2’: ‘value2’, …} |
Check out Usage Example.
An adapter that converts the passed Grid Model into Form Model for updating specified grid record on a separate form.
Parameters:
Type | Name | Description |
---|---|---|
GridModel | model | Required. The instance of a Grid model. |
Any | id | Required. Id of the grid record to be updated. |
Returns: new object with interface similar to Form Model.
Apply form changes
on the grid.
Parameters:
Type | Name | Description |
---|---|---|
Object | changes | Required. Changed grid record data to be applied on the grid. It is expected to be in the next format {‘field1’: ‘value1’, ‘field2’: ‘value2’, …} |
Check out Usage Example.