Skip to content

Fix: Resolve Mapped KeyProperty Conflict in Turbo Mode via Store.getKey() #9067

@tobiu

Description

@tobiu

Resolve keyProperty access conflicts when using Mapped Fields in Turbo Mode (autoInitRecords: false).

The Problem:

  1. Turbo Mode: Store holds raw objects. keyProperty points to the raw data key (e.g. 'l'). rawItem['l'] works.
  2. Lazy Instantiation: When accessed, raw objects become Records. RecordFactory creates getters for canonical field names (e.g. login), but NOT for mapped source keys. record['l'] is undefined.
  3. Selection Model: Uses record[store.getKeyProperty()]. If keyProperty is 'l', this fails on instantiated records.

The Fix:

  1. Neo.data.Store#getKey(item): Implement a helper method to resolve the key regardless of item type.
    • Try item[keyProp].
    • If undefined & item is Record, try item.get(keyProp).
  2. Refactor Selection Models: Update RowModel (and others) to use store.getKey(record) instead of direct access.

Goal: Transparently support mapped key properties in mixed Raw/Record environments.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreCore framework functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions