Refer to this example. I got an array named Header (store name for table header) and another array named Type (store class name for each column). I wonder how to get access to the Type array using Header index.
1 Answer
It appears that in a binding expression like that you need to call $index with brackets, i.e.:
$root.Type()[$index()]
Updated fiddle: http://jsfiddle.net/KuzGf/1/
1 Comment
Tom W Hall
No worries. The reason you need the brackets here is because the value of $index itself forms part of the binding expression which determines the value for "class". If you were binding to $index in isolation (e.g. to just render the index in a span) you wouldn't need it.