0

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 1

1

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/

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.