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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -