Tell me more ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I'm trying to use the new binding conventions in knockout to load data from a table row into a dialog without success.

I've tried to follow Steve Sanderson's reference implementation as closely as possible but it's not loading the data in the dialog.

I'm wondering if I have set observable on the property at the correct point. Should I set it observable in the appViewModel definition or when I assign the value to the property. Or is there something else I'm missing.

Here's a JSFiddle of my code.

share|improve this question
Could you include code in the question, please? – palacsint Aug 1 '12 at 1:42

1 Answer

up vote 1 down vote accepted

Close! I just made the this.currentItem an observable, then updated it in the select function:

Here you go: http://jsfiddle.net/G53RW/43/

share|improve this answer
OK, thanks for your help. I did make this.currentItem observable earlier but I see where I went wrong. I was trying to set currentItem as if it were a property and of course because it is now an observable I should have passed the value as a function parameter, i.e. model.currentItem(this) NOT model.currentItem = this – bitsprint Feb 7 '12 at 13:24
Could you include the code in the answer, please? – palacsint Aug 1 '12 at 1:43
@palacsint The code is in the fiddle: jsfiddle.net/G53RW/43 – paulslater19 Aug 1 '12 at 8:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.