Hi,
We are encountering some strange behaviour when we are assigning new ids to records in our tree grid. It seems that the root cause of this problem is the onModelChange
handler in Store.js
assumes the id fields is called id
. In our implementation, we set Model.idField
to be something different.
See this code snippet from onModelChange
:
if ('id' in wasSet) {
const { oldValue, value } = toSet.id;
me.updateDependentRecordIds(oldValue, value);
me.onRecordIdChange({ record, oldValue, value });
}
Should this be something like this, instead?
if (record.idField in wasSet) {
const { oldValue, value } = toSet[record.idField];
me.updateDependentRecordIds(oldValue, value);
me.onRecordIdChange({ record, oldValue, value });
}
If we call onRecordIdChange
manually when we assign the new id, everything works fine.
Thanks,
Josh