Skip to content

withFields - on the "fields" field, add "id" field for better handling of lists #8

@adrians5j

Description

@adrians5j

Currently, when you send data to a list of models (using fields field), the new data is just assigned and the old is lost.

This means that the data will always be marked as dirty, when in fact, only one field might have been changed. This prevents the users to do isDirty() checks completely.

By assigning IDs (a simple "id" field for every item), we can actually efficiently compare received data and current data in the field, and completely fix the problem explained above.

P.S. This should also tackle the following value: [] we needed to make here:

fields({ list: true, instanceOf: LockedFieldsModel, value: [] })

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions