The problem with using mapping plagin for nested arrays

254 views
Skip to first unread message

MAVi

unread,
Jan 21, 2012, 1:27:41 AM1/21/12
to knock...@googlegroups.com
Hello. I've got a problem with using mapping plagin. I can't make the handlers for nested arrays «values».   Link to jsFiddle - http://jsfiddle.net/MAVi/8WHeE/.
 I'd be grateful for any help. Thanks!

JohnEarles

unread,
Jan 21, 2012, 9:35:08 AM1/21/12
to KnockoutJS
Here is a working version:

http://jsfiddle.net/jearles/8WHeE/11/

MAVi

unread,
Jan 24, 2012, 9:22:56 AM1/24/12
to knock...@googlegroups.com
Thanks this is exactly what I needed.

MAVi

unread,
Jan 28, 2012, 2:47:52 AM1/28/12
to knock...@googlegroups.com
Hello. In my script appeared new problem, and I can't solve it. I want to implement a selection of filter by clicking on it. For filters that are loaded at the beginning it is easy, but filters are added using the push is not working. Link to jsFiddle -  http://jsfiddle.net/MAVi/8WHeE/18/
Prompt me please what I did wrong. And sorry for my English.

JohnEarles

unread,
Jan 28, 2012, 8:15:54 AM1/28/12
to KnockoutJS
The mapping plugin is making your "selected" property an observable
for existing items, but when you are pushing a new item you are just
setting "selected: 0". If you change this to "selected:
ko.observable(0)" things will work. Things need to be observable for
Knockout to do its automatic UI refreshing.

http://jsfiddle.net/jearles/8WHeE/19/

MAVi

unread,
Jan 28, 2012, 9:15:38 AM1/28/12
to knock...@googlegroups.com
Thank you very much!
Reply all
Reply to author
Forward
0 new messages