observe object in array

74 views
Skip to first unread message

Tinco

unread,
Aug 17, 2015, 2:58:22 AM8/17/15
to KnockoutJS
I created a observableArray in an object which belongs to a viewmodel, but the value in this array can't be updated after changed.  Any one has suggestions about it this issue? Many thanks!

Gunnar Liljas

unread,
Aug 17, 2015, 8:10:45 AM8/17/15
to knock...@googlegroups.com
"Value" binding to $data is fiddly (may work in later versions). Wrap in an object.


2015-08-17 8:58 GMT+02:00 Tinco <yyh...@gmail.com>:
I created a observableArray in an object which belongs to a viewmodel, but the value in this array can't be updated after changed.  Any one has suggestions about it this issue? Many thanks!

--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ggarcia271...@gmail.com

unread,
Aug 24, 2015, 4:37:04 PM8/24/15
to KnockoutJS
I don't really know if $data works without having something like $parent. See the attached screenshot for a description. Hope this helps.
learnknockoutjs.PNG

Michael Best

unread,
Aug 24, 2015, 5:12:19 PM8/24/15
to KnockoutJS
You'll need to bind to $rawData. See http://knockoutjs.com/documentation/binding-context.html
Reply all
Reply to author
Forward
0 new messages