I can't really provide you with a 100% suitable solution but I can tel you why you are getting this - The problems is not with knockout (or rather not because of it) - the binding of the view to the model happens before the actual view markup is attached to the document. It's loaded as a fragment I believe, so the igGrid
makes an attempt to select it with jQuery
and attach feature widgets to it - which obviously fails to get item that's not there yet.
I am not familiar with Hot Towel and I don't know how to get it to attach the markup first and then do Knockout bindings, so I kind of just helped it out by manually attaching the fragment to the body on beforehand in the ViewModelBinder.js
:
bind: function(obj, view) {
doBind(obj, view, function () {
if ((view.getAttribute("data-view") == "views/details") && ($(view).parent().length == 0)) {
$("#content").prepend(view);
}
ko.applyBindings(obj, view);
if (obj.setView) {
obj.setView(view);
}
});
}
And it almost works this way (moving the actual Durandal
wrapper makes it twitch a little). Now I know this is not the way to go, but it is to give you an idea what's wrong. Alternatively you can add
ko.applyBindings(settings.model, newChild);
In the entrance.js
startTransition
function and remove the extra prepend and the bind from above function. Still not good transition, but better.
P.S. Also noticed that when you go directly to the details view you don't wait for the loader, notice the Infragistics Loader is async and has a callback function which is how you actually wait for the Loader to be done :)