Access index of $parent in knockout.js Access index of $parent in knockout.js javascript javascript

Access index of $parent in knockout.js


to access the index of the parent object use

$parentContext.$index()

rather than

$parent.index()


The easiest way you can find out is download "knockout context" for chrome. This shows you what data is bound to what element and also lets you see the available functions/variables to that particular bound element. It's an amazing tool for situations like these.