knockout.js - Loading 1 observable into another, but modifying both at the same time -
in function have passed selecteditem observable function openalertdialogueedit.
openalertdialogueedit(selecteditem) { this.isalertdialogueineditmode(true); this.editingitemalert(selecteditem); this.isalertdialogueopen(true); } i debugging app , can see changes made editingitemalert observable bound controls in alertdialogueedit done. original selecteditem observable not changed. how can achieve behavior.
note, selecteditem passed via:
data-bind="click:function() { $parent.openalertdialogueedit($data)}"
doesn't pass in value of $data, rather observable itself? if want pass in observable, try assigning alias item in foreach, or else use index observable out of parent collection directly:
data-bind="click:function() { $parent.openalertdialogueedit($parent.observablearray()[$index])}"
Comments
Post a Comment