Closed joe912 closed 10 years ago
For the sortable functionality to work properly you need to have a single element inside of your sortable, so that the index of the element can be used to determine the position in the observableArray:
So you would want a structure more like:
<li>
<!-- ko if: Op() == 'plus' && Icon() != '' -->
<span>Has Icon</span><input type="text" data-bind="value: Icon" />
<!-- /ko -->
<!-- ko if: Op() == 'plus' && Icon() == '' -->
<span>No Icon</span><input type="text" data-bind="value: Op" />
<!-- /ko -->
</li>
Sample: http://jsfiddle.net/rniemeyer/fuy9r/
There is some functionality in the sortable binding that tries to strip leading and trailing non-elements and it is causing an issue in your scenario. This functionality could be refined to at least not generate the error that you are seeing, but without a single element you would likely see some issues with it not updating the appropriate index.
I will try to call this out in the documentation.
Ok thanks for the info.
By the way - thanks for creating this plugin! keep up the good work
Hi,
I came across this error when testing in IE8 mode (using IE11) and replicated on IE8 browserstack:
JQuery UI version is v1.9.1
Here is simple example showing a "foreach" data bind & a "sortable" data bind. The "foreach" bind works fine: