I am using knockout js on a view to display a list of fields (ie, first name, last name, etc). The fields are listed inside a knockout template using the an observable array
Here is a sample that might be similar to what you are doing: http://jsfiddle.net/rniemeyer/WpnTU/
It sets up the dialog when the page loads, but doesn't open it. Then, there is a custom binding handler that will get called whenever a "selectedItem" observable is populated (which could be with an existing item or a new item).
The simple custom binding handler looks like:
//custom binding handler that opens the jQuery dialog, if the selectedProduct is populated
ko.bindingHandlers.openDialog = {
update: function(element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor());
if (value) {
$(element).dialog("open");
}
}
}