ember.js - Deleted records are not accessible -
given model parent, hasmany childs.
how can track deleted childs? if ember keeps track of them, how access them?
i have complex form, user can add/edit/delete childs, have 1 place persists/cancel parent. in place persist/rollback childs.
i can manually keep track of deleted records, if ember keeps track of them, prefer use ed ;-)
i'm playing that, it's not working:
dirtytasks: ember.computed.filterby('model.childs.@each.content', 'isdirty', true), deletedtasks: ember.computed.filterby('model.childs.@each.content', 'isdeleted', true), changedtasks: ember.computed.union('dirtytasks', 'deletedtasks'), dirtytasks: ember.computed.filterby('model.childs.@each', 'isdirty', true), deletedtasks: ember.computed.filterby('model.childs.@each', 'isdeleted', true), changedtasks: ember.computed.union('dirtytasks', 'deletedtasks'), dirtytasks: ember.computed.filterby('model.childs.[]', 'isdirty', true), deletedtasks: ember.computed.filterby('model.childs.[]', 'isdeleted', true), changedtasks: ember.computed.union('dirtytasks', 'deletedtasks'),
also, in inspector, can see content.canonicalstate, content.currentstate, wich arrays rows, sure there easier way like: model.get('childs.deletedrecords') or similar ?
thanks
ok, found solution in slack ...
model.get('children').filterby('isdeleted')
Comments
Post a Comment