It looks like in IE you cannot change the type of an input element after it is added to the DOM.
The type property is read / write-once, but only when an input element is created using the createElement method and before it is added to the document.
http://msdn.microsoft.com/en-us/library/ms534700.aspx
There are some ugly problems associated with creating a new element and deleting an existing one, but for this you will need to write a custom mediation knockout.
You could get around it with if
binding :
<tr> <td data-bind="text: name"></td> <td> <span data-bind="if: dtype=='checkbox'"><input type='checkbox' /></span> <span data-bind="if: dtype=='text'"><input type='text' /></span> </td> </tr>
See: http://jsfiddle.net/GQEs5/
But it is really unsatisfactory and verbose.
I would also add that it is philosophically unclean to have presentation details in your model, but I definitely recognize the pragmatic advantages of your approach.
source share