update I have moved the code to jsFiddle http://jsfiddle.net/TnSV6/13/
when edit is called the model is set to a view model and the dialog is opened. however when save or undo is called the modal is set to null but the dialog does not close.
i can make this work if I explicitly use jquery in the jqDialog handler to make the cancel link and ajax complete event close the dialog box, but that feels a bit hackish because jqDialog.update should manage open/close.
it would seem a call is not begin forwarded to jqDialog.update(). but I’m not sure where that is being prevented.
Yes, what I said above is actually the issue. Inside of your
withthe observable has already been unwrapped, so you are just dealing with the contents ofSettingShipmentDate.workOrder. The custom binding does not know about the actual observable that holds it.An easy fix would be just to write it like:
Now your binding is passed the observable
workOrderrather than just its contents and the unwrapping that you do in the binding’supdatefunction will be able to create the dependency.Sample: http://jsfiddle.net/rniemeyer/Y4JbP/
Otherwise, you could refactor it a bit to move the
withstatement onto thedivor inside of it. Although, thewithis currently protecting against the value being null.