Neo.grid.Row (src/grid/Row.mjs) reads cell values via record.get(column.dataField), and Neo.data.Record#get(field) (src/data/RecordFactory.mjs:239-249) resolves both declared Model fields (this[field]) and undeclared dotted paths (if (field.includes('.')) return Neo.ns(field, false, this[dataSymbol])). Similarly, Neo.data.Store#getKey resolves dotted keyProperty paths on raw objects via Neo.ns.
However, sorting a collection, Store, or TreeStore by a dotted property path (such as a grid column with dataField: 'stats.running.throughput' pointing into an Object field or nested plain object) currently fails as a no-op:
Neo.collection.Sorter#defaultSortBy (src/collection/Sorter.mjs:123-135) and Neo.collection.Base#doSort (src/collection/Base.mjs:776-798) read item[property] directly. When property is a dotted path that is not a flat own property or declared Model getter on item, item[property] evaluates to undefined for every item, leaving the collection order unchanged.
Neo.data.TreeStore#sortArray (src/data/TreeStore.mjs:1011-1075) duplicates Neo.collection.Base#doSort's array-sorting logic to sort localized #childrenMap arrays in place, and has drifted behind collection.Base#doSort: it reads item[sortProperties[i]] directly, still uses {index, original: item} (vulnerable to the property: 'index' collision fixed in #20270), and uses raw > / < comparisons rather than Sorter.compareValues (fixed in #4044).
Neo.data.Store#doSort (src/data/Store.mjs:603-605) and Neo.data.TreeStore#doSort (src/data/TreeStore.mjs:410-412) in Turbo Mode (autoInitRecords: false) with model.hasComplexFields === true execute if (!Object.hasOwn(item, property)) { item[property] = me.resolveField(item, property) }. When property is an undeclared dotted path (!me.model.getField(property)), resolveField returns undefined (while resolveField already caches item[fieldName] = value for declared fields at Store.mjs:1693), so the caller stamps an own property item['a.b'] = undefined onto the raw item.
Design authority:tier-2 — local to src/collection/Sorter.mjs, src/collection/Base.mjs, src/data/Store.mjs, and src/data/TreeStore.mjs; extends property resolution to dotted paths while preserving $O(1)$ direct property/Symbol access and consolidating sortArray(arr) on Neo.collection.Base.
Solution
Add static getValue(item, property) on Neo.collection.Sorter (src/collection/Sorter.mjs):
First reads let value = item?.[property] so flat properties, Symbol keys (such as Symbol.for('initialIndex') in Store#sort()), and declared Model getters remain $O(1)$.
When value === undefined && typeof property === 'string' && property.includes('.'), resolves item.get(property) if typeof item.get === 'function' (Neo.data.Record instances) and falls back to Neo.ns(property, false, item) (plain objects in Collection / Turbo Mode Stores or calculated root getters on Records).
Wire Sorter.getValue into Sorter#defaultSortBy and move sortArray(arr) to Neo.collection.Base (src/collection/Base.mjs), where doSort(items=this._items, silent=false) delegates in-place array sorting to this.sortArray(items) (retaining this._items = items so filter()'s this.doSort(this.items, true) commits the sorted shallow clone from items_'s clone: 'shallow' getter) and Neo.data.TreeStore inherits sortArray(arr) directly (deleting the 65-line duplicated TreeStore#sortArray in src/data/TreeStore.mjs).
In Neo.data.Store#resolveField (src/data/Store.mjs), when !field and typeof fieldName === 'string' && fieldName.includes('.'), resolve the root segment (fieldName.split('.')[0]) if it is a declared Model field not yet on item and return Neo.ns(fieldName, false, item) without stamping a flat item[fieldName] cache key; update Store#doSort, Store#filter, TreeStore#doSort, and TreeStore#filter to call me.resolveField(item, property) without overwriting item[property] = undefined when !me.model.getField(property).
Returns undefined when !item. Otherwise reads item[property] directly ($O(1)$ for flat keys, Symbols, and declared Record getters); if undefined and typeof property === 'string' && property.includes('.'), calls item.get(property) when typeof item.get === 'function', then falls back to Neo.ns(property, false, item). Mutates nothing.
Neo.collection.Base#sortArray
protected
(arr: Object[])
Returns undefined (sorts and mutates arr in place using the collection's active sorters, Sorter.getValue, Sorter.compareValues, and a non-colliding Symbol('sortPosition') key; early-exits unchanged if < 2 items or 0 sorters). Inherited by Neo.data.TreeStore for #childrenMap sibling arrays.
Neo.data.Store#resolveField
public
(item: Object, fieldName: String)
For a declared Model field, computes and caches item[fieldName] = value and returns value. For an undeclared dotted fieldName (!field && fieldName.includes('.')), soft-hydrates rootField = fieldName.split('.')[0] on item if rootField is a declared Model field and !Object.hasOwn(item, rootField), then returns Neo.ns(fieldName, false, item) without stamping item[fieldName]. Returns undefined for unknown flat names.
Acceptance Criteria
AC-1 (Sorter.getValue & Collection sorting):Neo.collection.Sorter.getValue(item, property) resolves dotted string paths on both Neo.data.Record instances and plain objects while keeping flat properties and Symbol keys (Symbol.for('initialIndex')) intact, and Neo.collection.Base sorts items by dotted property paths with useTransformValue: true, useTransformValue: false, and mixed sortBy + defaultSortBy sorters.
AC-2 (Store & TreeStore sorting in Record and Turbo modes):Neo.data.Store and Neo.data.TreeStore sort by dotted property paths (including paths inside Object fields and calculated complex root fields) in both autoInitRecords: true (Record instances) and autoInitRecords: false (Turbo Mode raw objects) without stamping item['a.b'] = undefined on raw objects, and re-sorting reflects live mutations to nested properties.
AC-3 (TreeStore#sortArray deduplication):Neo.data.TreeStore inherits sortArray(arr) from Neo.collection.Base (removing the duplicate implementation in src/data/TreeStore.mjs), gaining Sorter.getValue, Sorter.compareValues, and sortPosition Symbol safety (property: 'index').
AC-4 (Unit tests): Playwright unit tests in test/playwright/unit/collection/SortDottedProperty.spec.mjs cover dotted property sorting across Collection, Store (Record + Turbo Mode + live nested mutation + store.sort() reset), and TreeStore (Record + Turbo Mode), and existing collection/ and data/ unit suites pass.
tobiu referenced in commit 20006c1 - "fix(collection): resolve dotted property paths in Sorter, Collection, and TreeStore (#20275) (#20276) on Nov 4, 2026, 9:06 PM
Problem
Neo.grid.Row(src/grid/Row.mjs) reads cell values viarecord.get(column.dataField), andNeo.data.Record#get(field)(src/data/RecordFactory.mjs:239-249) resolves both declaredModelfields (this[field]) and undeclared dotted paths (if (field.includes('.')) return Neo.ns(field, false, this[dataSymbol])). Similarly,Neo.data.Store#getKeyresolves dottedkeyPropertypaths on raw objects viaNeo.ns.However, sorting a collection,
Store, orTreeStoreby a dottedpropertypath (such as a grid column withdataField: 'stats.running.throughput'pointing into anObjectfield or nested plain object) currently fails as a no-op:Neo.collection.Sorter#defaultSortBy(src/collection/Sorter.mjs:123-135) andNeo.collection.Base#doSort(src/collection/Base.mjs:776-798) readitem[property]directly. Whenpropertyis a dotted path that is not a flat own property or declaredModelgetter onitem,item[property]evaluates toundefinedfor every item, leaving the collection order unchanged.Neo.data.TreeStore#sortArray(src/data/TreeStore.mjs:1011-1075) duplicatesNeo.collection.Base#doSort's array-sorting logic to sort localized#childrenMaparrays in place, and has drifted behindcollection.Base#doSort: it readsitem[sortProperties[i]]directly, still uses{index, original: item}(vulnerable to theproperty: 'index'collision fixed in#20270), and uses raw>/<comparisons rather thanSorter.compareValues(fixed in#4044).Neo.data.Store#doSort(src/data/Store.mjs:603-605) andNeo.data.TreeStore#doSort(src/data/TreeStore.mjs:410-412) in Turbo Mode (autoInitRecords: false) withmodel.hasComplexFields === trueexecuteif (!Object.hasOwn(item, property)) { item[property] = me.resolveField(item, property) }. Whenpropertyis an undeclared dotted path (!me.model.getField(property)),resolveFieldreturnsundefined(whileresolveFieldalready cachesitem[fieldName] = valuefor declared fields atStore.mjs:1693), so the caller stamps an own propertyitem['a.b'] = undefinedonto the raw item.Design authority:
tier-2— local tosrc/collection/Sorter.mjs,src/collection/Base.mjs,src/data/Store.mjs, andsrc/data/TreeStore.mjs; extends property resolution to dotted paths while preserving $O(1)$ direct property/Symbol access and consolidatingsortArray(arr)onNeo.collection.Base.Solution
static getValue(item, property)onNeo.collection.Sorter(src/collection/Sorter.mjs):let value = item?.[property]so flat properties,Symbolkeys (such asSymbol.for('initialIndex')inStore#sort()), and declaredModelgetters remain $O(1)$.value === undefined && typeof property === 'string' && property.includes('.'), resolvesitem.get(property)iftypeof item.get === 'function'(Neo.data.Recordinstances) and falls back toNeo.ns(property, false, item)(plain objects inCollection/ Turbo ModeStores or calculated root getters onRecords).Sorter.getValueintoSorter#defaultSortByand movesortArray(arr)toNeo.collection.Base(src/collection/Base.mjs), wheredoSort(items=this._items, silent=false)delegates in-place array sorting tothis.sortArray(items)(retainingthis._items = itemssofilter()'sthis.doSort(this.items, true)commits the sorted shallow clone fromitems_'sclone: 'shallow'getter) andNeo.data.TreeStoreinheritssortArray(arr)directly (deleting the 65-line duplicatedTreeStore#sortArrayinsrc/data/TreeStore.mjs).Neo.data.Store#resolveField(src/data/Store.mjs), when!fieldandtypeof fieldName === 'string' && fieldName.includes('.'), resolve the root segment (fieldName.split('.')[0]) if it is a declaredModelfield not yet onitemand returnNeo.ns(fieldName, false, item)without stamping a flatitem[fieldName]cache key; updateStore#doSort,Store#filter,TreeStore#doSort, andTreeStore#filterto callme.resolveField(item, property)without overwritingitem[property] = undefinedwhen!me.model.getField(property).Contract Ledger
Neo.collection.Sorter.getValuepublic static(item: Object|Neo.data.Record|null|undefined, property: String|Symbol)undefinedwhen!item. Otherwise readsitem[property]directly ($O(1)$ for flat keys,Symbols, and declaredRecordgetters); ifundefinedandtypeof property === 'string' && property.includes('.'), callsitem.get(property)whentypeof item.get === 'function', then falls back toNeo.ns(property, false, item). Mutates nothing.Neo.collection.Base#sortArrayprotected(arr: Object[])undefined(sorts and mutatesarrin place using the collection's activesorters,Sorter.getValue,Sorter.compareValues, and a non-collidingSymbol('sortPosition')key; early-exits unchanged if< 2items or0sorters). Inherited byNeo.data.TreeStorefor#childrenMapsibling arrays.Neo.data.Store#resolveFieldpublic(item: Object, fieldName: String)Modelfield, computes and cachesitem[fieldName] = valueand returnsvalue. For an undeclared dottedfieldName(!field && fieldName.includes('.')), soft-hydratesrootField = fieldName.split('.')[0]onitemifrootFieldis a declaredModelfield and!Object.hasOwn(item, rootField), then returnsNeo.ns(fieldName, false, item)without stampingitem[fieldName]. Returnsundefinedfor unknown flat names.Acceptance Criteria
Sorter.getValue&Collectionsorting):Neo.collection.Sorter.getValue(item, property)resolves dotted string paths on bothNeo.data.Recordinstances and plain objects while keeping flat properties andSymbolkeys (Symbol.for('initialIndex')) intact, andNeo.collection.Basesorts items by dottedpropertypaths withuseTransformValue: true,useTransformValue: false, and mixedsortBy+defaultSortBysorters.Store&TreeStoresorting in Record and Turbo modes):Neo.data.StoreandNeo.data.TreeStoresort by dottedpropertypaths (including paths insideObjectfields and calculated complex root fields) in bothautoInitRecords: true(Recordinstances) andautoInitRecords: false(Turbo Mode raw objects) without stampingitem['a.b'] = undefinedon raw objects, and re-sorting reflects live mutations to nested properties.TreeStore#sortArraydeduplication):Neo.data.TreeStoreinheritssortArray(arr)fromNeo.collection.Base(removing the duplicate implementation insrc/data/TreeStore.mjs), gainingSorter.getValue,Sorter.compareValues, andsortPositionSymbol safety (property: 'index').test/playwright/unit/collection/SortDottedProperty.spec.mjscover dottedpropertysorting acrossCollection,Store(Record + Turbo Mode + live nested mutation +store.sort()reset), andTreeStore(Record + Turbo Mode), and existingcollection/anddata/unit suites pass.