it's a little complicated for me to explain my issue. Basically i have viewmodel that i bind to a view, in that viewmodel i have a observable object that i bind to the view with a "with" tag from knockout. This property is called SelectedItem, because represent the item that you select from a grid. The data in this grid are plain objects, so i have to convert to obervable objects, in order to bind it to this view.
the issue comes when i have to bind the second object, the application just doesn't work.
i've created a fiddle for this issue. http://jsfiddle.net/q7q0f7oq/11/
Natal.applyBindings(myViewModel).done(function() {
Natal.Validation.init('#editForm');
});
this is a library that i use at my work, that encapsulate Knockoutjs and other libraries.
if you push the new button, then the save button (without completing anything) it will trigger the validation. then you close the window with the cancel button, and open the window again, pushing the new button again. when you try to execute the validation again, it will fail.
now, i could find that this is not the proper way to do this binding with Knockout, but i don't know what could i do to fix this. the only this that i come around with this, is to recycle the object, and don't create a new one.