The problem arises from the KnockoutJS statement with: ".
I assume that "with:" turns the strange "visible" or "display" property into false when ko.observable is empty, and then JQuery (mobile) trying to use the property to apply the style cannot find the DOM element with its selector. The crazy thing is that I did not find the source documenting the problem?
I experimented with a similar problem with some Jquery plugins before (datepicker, masked input ...), the solution I found was to reapply the JQuery plugin after binding the observable.
Unfortunately, this โhackingโ is not suitable in your case, since jQuery Mobile is not used manually using JavaScript. I was looking for some way to "upgrade" jQuery Mobile, but no result.
So, I came up with a solution by deleting the โwith:โ operator, naming the full name of the property and linking the empty โhospitalโ in the observable to rule out an exception using a NULL reference.
Jsfiddle
<span data-bind="text:hospitalList.selectedHospital().id"></span> self.selectedHospital = ko.observable({id:"",name:"",location:""});
This solution is far from ideal and not very scalable. But, on the contrary, it will check the code of both libraries to determine the "conflict".
Hope this helps!
Yoann
source share