【问题标题】:getParent Object from Array / Knockout / mapping.PlugingetParent Object from Array / Knockout / mapping.Plugin
【发布时间】:2012-07-03 12:17:55
【问题描述】:

看看小提琴:http://jsfiddle.net/kirtapatrik/LwBvc/
如果孩子是数组,为什么我没有得到父对象?

感谢支持 帕特里克

【问题讨论】:

  • Knockout Mapping 插件 v2.3.1

标签: knockout.js knockout-mapping-plugin


【解决方案1】:

你没有得到“父”对象,因为你正在渲染一个可观察的数组项。可观察数组项的父项是可观察数组本身。

这正如文档所述:http://knockoutjs.com/documentation/plugins-mapping.html

parent:这个孩子所属的父对象或数组

【讨论】:

    猜你喜欢
    • 2022-12-01
    • 2019-03-11
    • 2017-12-13
    • 2013-04-22
    • 2011-08-12
    • 2022-12-01
    • 1970-01-01
    • 2022-11-29
    • 1970-01-01
    相关资源
    最近更新 更多