knockout.js - Why do I have to set the former selected item to null after its removal -


when remove selected customer customer observablearray this:

var selectedrow = self.selected(); customers.remove(selectedrow); 

why have set selected object null explicitly...

self.selected(null); 

...because next time click remove customer button former deleted customer still returned selected() observable??

i assuming code snippet populate saying self.selected(myselectedvalue).

in code, removing item array, isn't connected self.selected() variable.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -